Add data-testid attribute to login and signup buttons for E2E tests #930
Workflow file for this run
This file contains hidden or 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: Frontend CI | |
| on: | |
| push: | |
| paths: | |
| - 'frontend/**' | |
| - '.github/workflows/frontend-ci.yml' | |
| pull_request: | |
| paths: | |
| - 'frontend/**' | |
| - '.github/workflows/frontend-ci.yml' | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: frontend | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| cache: 'npm' | |
| cache-dependency-path: frontend/package-lock.json | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Check formatting | |
| run: npm run format:check || npm run format -- --check | |
| - name: Lint | |
| run: npm run lint | |
| - name: Type check | |
| run: npm run typecheck || npm run check:types || npm run tsc | |
| - name: Create test environment file | |
| run: | | |
| mkdir -p /tmp | |
| echo "VITE_API_URL=http://localhost:8000/api/v1" > .env.test | |
| echo "VITE_SUPABASE_URL=https://example.supabase.co" >> .env.test | |
| echo "VITE_SUPABASE_ANON_KEY=test-supabase-key" >> .env.test | |
| - name: Install dotenv for env checking | |
| run: npm install dotenv --no-save | |
| - name: Check environment variables | |
| run: node scripts/check-env.js .env.test | |
| - name: Build | |
| env: | |
| CI: "true" | |
| VITE_API_URL: "http://localhost:8000/api/v1" | |
| VITE_SUPABASE_URL: "https://example.supabase.co" | |
| VITE_SUPABASE_ANON_KEY: "test-supabase-key" | |
| VITE_DEV_MODE: "false" | |
| run: npm run build | |
| - name: Run tests with coverage | |
| run: | | |
| export NODE_OPTIONS="--max-old-space-size=8192" | |
| npm test -- --coverage | |
| - name: Upload coverage report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-report | |
| path: frontend/coverage |