-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.44 KB
/
main.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
name: CI
on:
push:
branches: [ '*' ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
tests-and-coverage:
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'poetry'
- run: poetry install --with dev,ci
- name: Unit tests and coverage
run: |
poetry run coverage run -m nose2
poetry run coverage xml
- name: Code Coverage Report
run: |
poetry run coverage report --omit "/usr/*"
cov=$(poetry run coverage report --omit "/usr/*" | grep TOTAL | awk '{print $4}')
echo $cov
echo "COVERAGE=${cov:0:-1}" >> $GITHUB_ENV
- name: Create Awesome Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.SEISSOL_MATRICES_GIST }}
gistID: b9c4e4cac4b1c91e4645e5a319e18c9a
filename: seissol-matrices.json
label: Coverage
message: ${{ env.COVERAGE }}
valColorRange: ${{ env.COVERAGE }}
maxColorRange: 100
minColorRange: 0k
forceUpdate: true
- name: Coding style
run: |
poetry run black --check src
poetry run black --check tests