Part 6 pw #31
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: PR Check | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| test: | |
| name: Run Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| - name: Generate environment.ts from secrets | |
| shell: bash | |
| run: | | |
| cat > src/environments/environment.ts <<'EOF' | |
| export const environment = { | |
| production: false, | |
| supabaseUrl: '${{ secrets.SUPABASE_URL }}', | |
| supabaseKey: '${{ secrets.SUPABASE_ANON_KEY }}', | |
| }; | |
| EOF | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run unit tests with headless Chrome | |
| run: npm run test -- --browsers=ChromeHeadless --watch=false --no-progress |