Update README #118
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: Playwright Tests | |
on: ['push', 'pull_request'] | |
jobs: | |
build_test: | |
name: Build and test | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Lint | |
run: pnpm run lint | |
- name: Build | |
run: pnpm run build | |
- name: Test | |
run: pnpm run test | |
- name: Upload artifact | |
if: success() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: lib | |
path: dist | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
release: | |
if: startsWith(github.event.ref, 'refs/tags/v') | |
name: Publish new release | |
needs: build_test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
registry-url: https://registry.npmjs.org/ | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: lib | |
path: dist | |
- name: Publish | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |