Skip to content

Commit

Permalink
test: Create Workflow for unit testing. (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matte22 authored Feb 22, 2024
1 parent e398da9 commit d007792
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
-Dsonar.projectName=NUWCDIVNPT_stigman-watcher
-Dsonar.organization=nuwcdivnpt
-Dsonar.inclusions=**/*.js
-Dsonar.exclusions=**/node_modules/**,
-Dsonar.exclusions=**/node_modules/**,**/test/**,**/coverage/**


# This will fail the action if Quality Gate fails (leaving out for now )
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/unit-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Run Unit Tests and Upload Coverage Artifact
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "lib/**"
- "index.js"
- "test/**"
pull_request:
branches:
- main
paths:
- "lib/**"
- "index.js"
- "test/**"

jobs:
build_test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install app dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Upload coverage to github
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: coverage
path: coverage

0 comments on commit d007792

Please sign in to comment.