-
Notifications
You must be signed in to change notification settings - Fork 11
83 lines (70 loc) · 2.12 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: CI
on: [push]
jobs:
test:
name: Test
runs-on: ubuntu-latest
container:
image: ghcr.io/scientificcomputing/fenics-gmsh:2023-08-16
steps:
- uses: actions/checkout@v3
- name: Cache
id: cache-primes
uses: actions/cache@v3
with:
path: |
~/.cache/instant
~/.cache/dijitso
~/.cache/pip
key: cache_v5
restore-keys: |
cache_v5
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install h5py --no-binary=h5py
python3 -m pip install -e ".[dev]"
- name: Test with pytest
run: |
python3 -m pytest
- name: Extract Coverage
run: |
python3 -m coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY
python3 -m coverage json
export TOTAL=$(python3 -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
- name: Upload HTML report.
uses: actions/upload-artifact@v3
with:
name: html-report
path: htmlcov
- name: Create coverage Badge
if: github.ref == 'refs/heads/main'
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: a7290de789564f03eb6b1ee122fce423
filename: simcardems-coverage.json
label: Coverage
message: ${{ env.total }}%
minColorRange: 50
maxColorRange: 90
valColorRange: ${{ env.total }}
- name: Install pypa/build
run: >-
python3 -m
pip install
build
- name: Build a binary wheel and a source tarball
run: >-
python3 -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}