Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,28 @@ jobs:

# Runs a set of commands using the runners shell
- name: Test
run: npm run test-jenkins
uses: mattallty/jest-github-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# this is just an example, this could be any command that will trigger jest
test-command: "npm run coverage-jenkins"

- name: Save Code Linting Report JSON
run: npm run lint:json
# Continue to the next step even if this fails
continue-on-error: true

- name: Annotate Code Linting Results
uses: ataylorme/eslint-annotate-action@1.2.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
report-json: "./coverage/eslint-result.json"

# Upload test results
- uses: actions/upload-artifact@v2
if: success() || failure() # run this step even if previous step failed
with:
name: test-results
path: ./coverage/test.results.xml
path: |
./coverage/
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"test": "jest",
"test-jenkins": "jest --reporters=default --reporters=jest-junit",
"coverage-jenkins": "jest --reporters=default --reporters=jest-junit --coverage --coverageReporters=text --coverageReporters=html --coverageDirectory=./coverage/",
"lint": "eslint src/**/*.js -f checkstyle -o coverage/eslint-result.xml"
"lint": "eslint src/**/*.js -f checkstyle -o coverage/eslint-result.xml",
"lint:json": "eslint src/**/*.js --format json -o coverage/eslint-result.json"
},
"jest-junit": {
"outputDirectory": "./coverage/",
Expand Down