Skip to content

Commit bd41776

Browse files
author
Benjamin Muskalla
committed
Add workflow to upload metrics
1 parent a1432c4 commit bd41776

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: "Publish framework coverage as metrics"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
pull_request:
9+
branches:
10+
- main
11+
paths:
12+
- ".github/workflows/csv-coverage-metrics.yml"
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v2
20+
- name: Setup CodeQL
21+
uses: ./.github/actions/fetch-codeql
22+
- name: Create empty database
23+
run: |
24+
DATABASE="${{ runner.temp }}/java-database"
25+
PROJECT="${{ runner.temp }}/java-project"
26+
mkdir -p $PROJECT/src/tmp/empty
27+
echo "class Empty {}" >> $PROJECT/src/tmp/empty/Empty.java
28+
codeql database create $DATABASE --language=java --source-root=$PROJECT --command 'javac src/tmp/empty/Empty.java'
29+
- name: Capture coverage information
30+
run: |
31+
DATABASE="${{ runner.temp }}/java-database"
32+
codeql database analyze --format=sarif-latest --output=metrics.sarif -- $DATABASE ./java/ql/src/Diagnostics/CoverageDiagnostics.ql
33+
- uses: actions/upload-artifact@v2
34+
with:
35+
name: metrics.sarif
36+
path: metrics.sarif
37+
retention-days: 20
38+
- name: Upload SARIF file
39+
uses: github/codeql-action/upload-sarif@v1
40+
with:
41+
sarif_file: metrics.sarif

0 commit comments

Comments
 (0)