Skip to content

Commit

Permalink
ci(qodana): enable code coverage in qodana
Browse files Browse the repository at this point in the history
- enable code coverage in qodana
- enable security scan upload
- enable auto fix in qodana
  • Loading branch information
ryanvade committed Nov 24, 2023
1 parent 94077c4 commit d9031fb
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 5 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/qodana_code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ jobs:
# noinspection SpellCheckingInspection
if: github.repository_owner == 'ryanvade'
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
security-events: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js 20.x
Expand All @@ -25,8 +30,23 @@ jobs:
key: ${{ runner.os }}-node-qodana-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Install Dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Archive coverage data
uses: actions/upload-artifact@v3
with:
name: jest-coverage-data
path: .qodana/code-coverage
- name: 'Qodana Scan'
uses: JetBrains/[email protected]
with:
args: --apply-fixes
push-fixes: pull-request
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: ${{ runner.temp }}/qodana/results/qodana.sarif.json
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules/
.idea/
.qodana/
4 changes: 3 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,7 @@ module.exports = {
transform: {
'^.+\\.ts$': 'ts-jest'
},
verbose: true
verbose: true,
coverageDirectory: '.qodana/code-coverage/',
coverageReporters: ['lcovonly']
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"package": "tsc && ncc build --source-map --license licenses.txt",
"test": "jest"
"test": "jest --coverage"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit d9031fb

Please sign in to comment.