This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
[Issue #183] Opportunity Page Design Implementation #223
Workflow file for this run
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: Frontend Checks | |
on: | |
workflow_call: | |
pull_request: | |
paths: | |
- frontend/** | |
- .github/workflows/ci-frontend.yml | |
defaults: | |
run: | |
working-directory: ./frontend | |
env: | |
NODE_VERSION: 18 | |
LOCKFILE_PATH: ./frontend/package-lock.json # or yarn.lock | |
PACKAGE_MANAGER: npm # or yarn | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
tests: | |
name: FE Lint, Type Check, Format & Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache-dependency-path: ${{ env.LOCKFILE_PATH }} | |
cache: ${{ env.PACKAGE_MANAGER }} | |
- run: npm ci | |
- name: Run lint | |
run: npm run lint | |
- name: Run type check | |
run: npm run ts:check | |
- name: Run format | |
run: npm run format-check | |
- run: npm run test -- --testLocationInResults --json --outputFile=coverage/report.json | |
- uses: ArtiomTr/jest-coverage-report-action@v2 | |
with: | |
coverage-file: coverage/report.json | |
test-script: npm test | |
working-directory: ./frontend | |
annotations: failed-tests | |
package-manager: npm | |
icons: emoji | |
skip-step: none | |
output: comment | |
# Confirms the front end still builds successfully | |
check-frontend-builds: | |
name: FE Build Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache-dependency-path: ${{ env.LOCKFILE_PATH }} | |
cache: ${{ env.PACKAGE_MANAGER }} | |
# https://nextjs.org/docs/advanced-features/ci-build-caching | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.npm | |
${{ github.workspace }}/frontend/.next/cache | |
# Generate a new cache whenever packages or source files change. | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} | |
# If source files changed but packages didn't, rebuild from a prior cache. | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}- | |
- run: npm ci | |
- run: npm run build -- --no-lint | |
# Confirms Storybook still builds successfully | |
check-storybook-builds: | |
name: FE Storybook Build Check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
cache-dependency-path: ${{ env.LOCKFILE_PATH }} | |
cache: ${{ env.PACKAGE_MANAGER }} | |
- run: npm ci | |
- run: npm run storybook-build | |
vulnerability-scans: | |
name: Run Frontend Vulnerability Scans | |
uses: ./.github/workflows/vulnerability-scans.yml | |
with: | |
app_name: 'frontend' |