Skip to content

Commit

Permalink
Added lint reporting and updated GitHub action.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnettwilliam committed Feb 20, 2024
1 parent f609936 commit 7ed4bdf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,26 @@ jobs:
npm install -g karma-cli
- name: Code linting
run: npm run lint

run: npm run lint --workspaces

- name: Create lint report
if: success() || failure()
uses: dorny/test-reporter@v1
with:
name: Lint Results
path: "\
platform/reports/lint-results.xml,\
tokenserver/reports/lint-results.xml"
reporter: java-junit
fail-on-error: true

- name: Build the education platform
if: success() || failure()
run: npm run build --workspaces

- name: Run the unit tests
run: npm test --workspaces

- name: Create test report
uses: dorny/test-reporter@v1
if: success() || failure()
Expand Down
2 changes: 1 addition & 1 deletion platform/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "webpack --mode=development",
"package": "copyfiles -u 1 \"public/**/*\" dist",
"start": "docker compose up --build --force-recreate",
"lint": "eslint src/**/*.js"
"lint": "eslint src/**/*.js --format junit --output-file ./reports/lint-results.xml"
},
"devDependencies": {
"copyfiles": "^2.4.1",
Expand Down
2 changes: 1 addition & 1 deletion tokenserver/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "tsc",
"start": "node -r dotenv/config ./dist/server.js",
"test": "echo \"Warning: no tests to run.\"",
"lint": "eslint src/**/*.js"
"lint": "eslint src/**/*.js --format junit --output-file ./reports/lint-results.xml"
},
"dependencies": {
"@octokit/auth-oauth-app": "7",
Expand Down

0 comments on commit 7ed4bdf

Please sign in to comment.