make the worflow file effortless #2
Workflow file for this run
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: CI | |
on: [pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm ci | |
- name: Check formatting | |
run: npm run format | |
- name: Lint code | |
run: npm run lint | |
- name: Check types | |
run: npm run typecheck | |
- name: Build extension | |
run: npm run build | |
test: | |
needs: build | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps chromium | |
- name: Run tests | |
run: npm run test | |
# Upload test results on failure | |
- uses: actions/upload-pages-artifact@v3 | |
if: failure() | |
with: | |
path: playwright-report/ | |
deploy-test-result: | |
if: always() && needs.test.result == 'failure' | |
needs: test | |
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
permissions: | |
pages: write # to deploy to Pages | |
id-token: write # to verify the deployment originates from an appropriate source | |
# Deploy to the github-pages environment | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
# Specify runner + deployment step | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |