Add authentication and prediction caching #28
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 | |
on: | |
push: | |
branches: [ main ] | |
paths: | |
- frontend/** | |
pull_request: | |
paths: | |
- frontend/** | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
defaults: | |
run: | |
working-directory: frontend | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'pnpm' | |
cache-dependency-path: 'frontend/pnpm-lock.yaml' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Check formatting | |
run: pnpm run format:check | |
- name: Lint | |
run: pnpm run lint | |
- name: Test and coverage | |
run: pnpm run test:coverage | |
- name: Code coverage report | |
if: always() | |
uses: davelosert/vitest-coverage-report-action@v1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
working-directory: frontend | |
build: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
defaults: | |
run: | |
working-directory: frontend | |
needs: test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18' | |
cache: 'pnpm' | |
cache-dependency-path: 'frontend/pnpm-lock.yaml' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build | |
run: pnpm run build | |
- name: Upload production-ready build files | |
uses: actions/upload-artifact@v2 | |
with: | |
name: frontend | |
path: frontend/build |