generated from Ingenjorsarbete-For-Klimatet/ifk-python-template
-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (37 loc) · 1.22 KB
/
github-action-build.yaml
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
name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"
- name: Test with pytest
run: |
pytest --cov-report term-missing --cov=src tests
coverage json
- name: Export summary stats
run: |
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
- name: Coverage badge
uses: schneegans/dynamic-badges-action@v1.6.0
with:
auth: ${{ secrets.BADGE_SECRET }}
gistID: 0c2ffec41439b2380c35c98bc018104a
filename: ifk-sweden-map-coverage-badge.json
label: Coverage
message: ${{ env.total }}%
minColorRange: 50
maxColorRange: 90
valColorRange: ${{ env.total }}