-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (45 loc) · 1.74 KB
/
report.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Status Report
on:
workflow_call:
secrets:
ALTERNATIVE_GITHUB_TOKEN:
required: false
jobs:
report:
name: Generate Status Report
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.ALTERNATIVE_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
steps:
- name: SCM Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python & Poetry Environment
uses: exasol/python-toolbox/.github/actions/[email protected]
- name: Download Artifacts
uses: actions/download-artifact@v3
with:
path: ./artifacts
- name: Copy Artifacts into Root Folder
if: ${{ (hashFiles('./artifacts/.coverage/.coverage') != '') && (hashFiles('./artifacts/.lint.txt/.lint.txt') != '')}}
working-directory: ./artifacts
run: |
cp .coverage/.coverage ../
cp .lint.txt/.lint.txt ../
- name: Generate Report
run: poetry run nox -s report -- -- --format json | tee metrics.json
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: metrics.json
path: metrics.json
- name: Generate GitHub Summary
if: ${{ (hashFiles('./artifacts/.coverage/.coverage') != '') && (hashFiles('./artifacts/.lint.txt/.lint.txt') != '')}}
run: |
echo -e "# Summary\n" >> $GITHUB_STEP_SUMMARY
poetry run nox -s report -- -- --format markdown >> $GITHUB_STEP_SUMMARY
echo -e "\n\n# Coverage\n" >> $GITHUB_STEP_SUMMARY
poetry run coverage report -- --format markdown >> $GITHUB_STEP_SUMMARY
echo -e "\n\n# Static Code Analysis\n" >> $GITHUB_STEP_SUMMARY
cat .lint.txt >> $GITHUB_STEP_SUMMARY