diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3327cd4..229b9b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 \ No newline at end of file + path: | + ./coverage/ \ No newline at end of file diff --git a/package.json b/package.json index 96e93bc..2c419cb 100644 --- a/package.json +++ b/package.json @@ -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/",