chore: use playwright cache for ci tests #24
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: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
check-and-test: | |
name: Check and Test | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
# Check: https://github.com/vercel/next.js/issues/53959 | |
# - name: Check types | |
# run: npm run check-types | |
- name: Check linting | |
run: npm run lint | |
- name: Run tests | |
run: npm run test | |
web-e2e-tests: | |
name: Web E2E Tests | |
timeout-minutes: 15 | |
runs-on: ubuntu-latest | |
needs: [check-and-test] | |
container: | |
image: mcr.microsoft.com/playwright:v1.50.0-noble | |
options: --user 1001 | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: '.nvmrc' | |
cache: 'npm' | |
- name: Install dependencies for web | |
run: npm install --filter=@tech-companies-portugal/web | |
- name: Run Playwright tests | |
run: npm run test:e2e:web | |
- name: Upload test results | |
if: ${{ !cancelled() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: playwright-report-web | |
path: ./apps/web/playwright-report/ | |
retention-days: 2 | |