test: manage playwright through pnpm instead of devbox #420
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test | |
# As recommended by Graphite | |
# (https://graphite.dev/docs/github-configuration-guidelines#github-actions) | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened] | |
push: | |
branches: [main] | |
# Cancel in-progress jobs for the same work | |
# (https://graphite.dev/docs/troubleshooting#why-are-my-actions-running-twice) | |
concurrency: | |
group: ${{ github.repository }}-${{ github.workflow }}-${{ github.ref }}-${{ github.ref == 'refs/heads/main' && github.sha || ''}} | |
cancel-in-progress: true | |
jobs: | |
test-misc: | |
# All non-E2E tests/validations. Runs inside Devbox. | |
name: Misc tests/validations | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install devbox | |
uses: jetpack-io/[email protected] | |
with: | |
enable-cache: true | |
devbox-version: 0.13.6 | |
- name: Install dependencies | |
run: devbox run pnpm install | |
- name: Validate and Build | |
run: devbox run pnpm exec turbo run build test:unit lint format check:dependencies check:types check:exports | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: "**/playwright-report/" | |
retention-days: 30 | |
test-e2e: | |
# These run outside of Devbox, since Devbox doesn't play well with Playwright | |
name: End-to-end Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
# no version specified (uses version in packageManager field in | |
# package.json) | |
run_install: false | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.11.1 | |
cache: "pnpm" | |
- name: Install dependencies | |
run: pnpm install | |
- name: Validate and Build | |
run: pnpm exec turbo run test:e2e | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: "**/playwright-report/" | |
retention-days: 30 |