Skip to content

Commit

Permalink
test (#27)
Browse files Browse the repository at this point in the history
* test

* try use node version 18
  • Loading branch information
yzlucas authored Sep 17, 2024
1 parent f0d081c commit 2d98013
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,17 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [18.x] # Use LTS Node.js version

steps:
- uses: actions/checkout@v4

# Install Python and build tools
- name: Install Python and build tools
run: |
sudo apt-get update
sudo apt-get install -y python3 python3-pip build-essential
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
Expand All @@ -29,12 +36,15 @@ jobs:
- name: Add .npmrc file
run: echo -e $NPMRC > ~/.npmrc

# Install dependencies
# Clean npm cache and install dependencies
- run: npm cache clean --force
- run: rm -rf node_modules
- run: npm install
working-directory: client/wfprev-war/src/main/angular

# Run unit tests and generate code coverage
- run: npm run test -- --watch=false --code-coverage
working-directory: client/wfprev-war/src/main/angular

# Ensure coverage meets the required threshold
- name: Check code coverage
Expand All @@ -43,4 +53,4 @@ jobs:
echo "Test passed";
else
echo "Code coverage is less than 80%! Exiting...";
exit 1;
exit 1;

0 comments on commit 2d98013

Please sign in to comment.