action: fix release workflow #7
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: Run Tests | |
| on: | |
| pull_request: | |
| branches: ["main", "master"] | |
| push: | |
| branches: ["main", "master"] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| node-version: [20.x] | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js ${{ matrix.node-version }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run linter | |
| run: npm run lint | |
| - name: Run tests | |
| run: npm run test -- --run | |
| env: | |
| VITE_SUPABASE_URL: https://test.supabase.co | |
| VITE_SUPABASE_ANON_KEY: test-key | |
| - name: Build project | |
| run: npm run build | |
| env: | |
| VITE_SUPABASE_URL: https://test.supabase.co | |
| VITE_SUPABASE_ANON_KEY: test-key | |
| - name: Upload test results | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results | |
| path: | | |
| coverage/ | |
| test-results/ | |
| retention-days: 30 |