Skip to content

Commit 1f141d5

Browse files
author
Babali42
committed
chore(ci) ensure CI fails if there are too much errors
1 parent 0f3f2fd commit 1f141d5

4 files changed

Lines changed: 32 additions & 12 deletions

File tree

.github/actions/test/action.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,10 @@ runs:
2525
working-directory: ./frontend
2626

2727
- name: Run ESLint
28-
run: npx eslint . --format @microsoft/eslint-formatter-sarif --output-file eslint-results.sarif
28+
run: npm run lint
2929
shell: bash
3030
working-directory: ./frontend
3131

32-
- name: Upload ESLint results to GitHub
33-
if: always()
34-
uses: github/codeql-action/upload-sarif@v4
35-
with:
36-
sarif_file: frontend/eslint-results.sarif
37-
wait-for-processing: true
38-
3932
- name: Run angular/karma tests
4033
run: npm run test-ci
4134
shell: bash

.github/workflows/angular-deploy-github-pages.yml

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ name: Deploy Angular App to GitHub Pages
22

33
permissions:
44
contents: write
5-
security-events: write
65

76
on:
87
push:
@@ -55,4 +54,32 @@ jobs:
5554
- uses: peaceiris/actions-gh-pages@v4
5655
with:
5756
github_token: ${{ secrets.GITHUB_TOKEN }}
58-
publish_dir: ./
57+
publish_dir: ./
58+
59+
sarif:
60+
if: always()
61+
needs: deploy
62+
runs-on: ubuntu-latest
63+
continue-on-error: true
64+
permissions:
65+
contents: read
66+
security-events: write
67+
steps:
68+
- uses: actions/checkout@v6
69+
70+
- uses: actions/setup-node@v6
71+
with:
72+
node-version: '26'
73+
cache: npm
74+
cache-dependency-path: frontend/package-lock.json
75+
76+
- run: npm ci
77+
working-directory: frontend/
78+
79+
- run: npx eslint . --max-warnings=10 -f @microsoft/eslint-formatter-sarif -o eslint-results.sarif || true
80+
working-directory: frontend/
81+
82+
- uses: github/codeql-action/upload-sarif@v4
83+
with:
84+
sarif_file: frontend/eslint-results.sarif
85+
wait-for-processing: true

.github/workflows/angular-tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77

88
permissions:
99
contents: read
10-
security-events: write
1110

1211
jobs:
1312
test:

frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"test": "ng test --code-coverage --watch",
1010
"test-ci": "ng test --code-coverage --no-watch --browsers=ChromeHeadless",
1111
"test-vitest": "vitest",
12-
"test-vitest-coverage": "vitest run --coverage"
12+
"test-vitest-coverage": "vitest run --coverage",
13+
"lint": "eslint . --max-warnings=10"
1314
},
1415
"private": true,
1516
"dependencies": {

0 commit comments

Comments
 (0)