test: add e2e test suite (protocol + browser) (#25) #20
This file contains hidden or 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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| concurrency: ${{ github.workflow }}-${{ github.ref }} | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| - name: Update npm for OIDC trusted publishing | |
| run: npm install -g npm@latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build | |
| run: bun run build | |
| - name: Unit tests | |
| run: bun run test:unit | |
| - name: E2E tests (protocol) | |
| run: bun run --filter e2e-tests test:protocol | |
| - name: Install Playwright | |
| run: npx --prefix packages/e2e-tests playwright install --with-deps chromium | |
| - name: E2E tests (browser) | |
| run: bun run --filter e2e-tests test:browser | |
| - name: Create release PR or publish | |
| id: changesets | |
| uses: changesets/action@v1 | |
| with: | |
| publish: bun run release | |
| version: bun run version | |
| title: 'chore(release): version packages' | |
| commit: 'chore(release): version packages' | |
| createGithubReleases: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish canary snapshot | |
| if: steps.changesets.outputs.published != 'true' | |
| run: | | |
| git checkout ${{ github.sha }} | |
| bun install | |
| bun run build | |
| npx changeset version --snapshot canary | |
| npx changeset publish --tag canary --no-git-tag |