Skip to content

Commit

Permalink
attempt to add ci for frontend lint and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
acrantel committed Jun 27, 2023
1 parent a571eae commit d28497b
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,38 @@ env:
CACHE_NUMBER: 1

jobs:
unit-test-frontend:
# Defines the type of runner the job runs on
runs-on: ubuntu-latest
steps:
- name: Checkout to the repository
uses: actions/checkout@v3
- name: Set up NodeJS environment
uses: actions/setup-node@v3
with:
node-version: '14'
# Consider this as an add on to optimize the execution of actions
- name: Cache node modules
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install package dependencies
run: cd frontend2 && npm install
- name: Check linting and formatting
# Custom script for checking the linting and formatting being in place
run: cd frontend2 && npm run lint
# Run test cases and this could ensure minimum coverage as well if set
- name: Execute test cases
run: cd frontend2 && npm run test
lint:
name: Linter (pre-commit)
runs-on: ubuntu-latest
Expand All @@ -40,7 +72,7 @@ jobs:
run: |
pre-commit install
pre-commit run -a
unit-test:
unit-test-backend:
name: Unit tests (django)
runs-on: ubuntu-latest
permissions:
Expand Down

0 comments on commit d28497b

Please sign in to comment.