Skip to content

Commit

Permalink
handled frontend ci
Browse files Browse the repository at this point in the history
  • Loading branch information
haydencleary committed Aug 6, 2024
1 parent e7656fc commit a3687ca
Show file tree
Hide file tree
Showing 3 changed files with 291 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/frontend-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Frontend CI

on:
pull_request: ~

push:
branches:
- "main"
- "hotfix/**"

workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)"
required: false
default: false

env:
NEXT_PUBLIC_ENV: local
NODE_OPTIONS: --max_old_space_size=4096

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
- run: npm ci
- run: npm run lint

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- name: Run unit/integration test
run: npm run coverage
- name: Setup tmate session for debugging
uses: mxschmitt/action-tmate@v3
if: ${{ failure() && inputs.debug_enabled }}
- name: Upload unit/integration tests coverage
uses: codecov/codecov-action@v4
with:
files: coverage/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Clean coverage
run: rm -rf coverage
234 changes: 234 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"test": "vitest"
"test": "vitest",
"coverage": "vitest --coverage"
},
"dependencies": {
"@auth0/auth0-react": "^2.2.4",
Expand All @@ -22,6 +23,7 @@
"@types/react": "^18",
"@types/react-dom": "^18",
"@vitejs/plugin-react": "^4.3.1",
"@vitest/coverage-v8": "^2.0.5",
"eslint": "^8",
"eslint-config-next": "14.2.5",
"eslint-config-prettier": "^9.1.0",
Expand Down

0 comments on commit a3687ca

Please sign in to comment.