Merge pull request #62 from talDoFlemis/dev #22
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: E2E Tests | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main, dev] | |
env: | |
NEXTAUTH_URL: "http://localhost:3000" | |
NEXTAUTH_SECRET: "saidmarinaamoreternoA8GPVSoaK/mUU=" | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
cache: "npm" | |
cache-dependency-path: "./frontend/package-lock.json" | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: "1.22.x" | |
cache-dependency-path: backend/go.sum | |
- name: Install Task | |
uses: arduino/setup-task@v1 | |
with: | |
version: 3.x | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Up database | |
run: task db-up -- -d | |
- name: Migrate database | |
run: task backend:migrate | |
- name: Seed database | |
run: task backend:seed | |
- name: Run backend | |
run: task backend:run-web -- & | |
- name: Get installed Playwright version | |
id: playwright-version | |
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV | |
working-directory: frontend | |
- name: Cache playwright binaries | |
uses: actions/cache@v3 | |
id: playwright-cache | |
with: | |
path: | | |
~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }} | |
- name: Install dependencies | |
run: npm ci | |
working-directory: frontend | |
- run: npx playwright install --with-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
working-directory: frontend | |
- run: npx playwright install-deps | |
if: steps.playwright-cache.outputs.cache-hit != 'true' | |
working-directory: frontend | |
- name: Run Playwright tests | |
run: npx playwright test | |
working-directory: frontend | |
- uses: actions/upload-artifact@v4 | |
if: ${{ !cancelled() }} | |
with: | |
name: playwright-report | |
path: frontend/playwright-report/ | |
retention-days: 30 |