Initial commit #20
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] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
unit_tests: | |
name: Unit tests | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Run unit tests | |
run: npm run test:coverage | |
- name: Upload Jest coverage report | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coverage | |
retention-days: 5 | |
e2e_tests: | |
name: End-to-end tests | |
needs: [build, unit_tests] | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
env: | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
NEXT_PUBLIC_BASE_URL: http://localhost:3000 | |
SQLITE_DB_FILENAME: sqlite_test.db | |
FORCE_COLOR: 2 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm install | |
- name: Install chromium | |
run: npx playwright install chromium | |
- name: Build | |
run: npm run build | |
- name: Start app and run e2e tests | |
run: npx playwright test |