Skip to content

Commit 50a2f52

Browse files
authored
Fix CI on PR from fork (#125)
* Run style checks on PR * speed up tests for testing * only upload to coveralls from main * $ * assert coveralls is hgh enough * run all the tests * \? * Coveralls check * ignore coveralls * .github/
1 parent e854224 commit 50a2f52

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

.github/scripts/coveralls_check.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
with open(".coveralls_output") as f:
2+
assert int(f.read().split("TOTAL")[-1].split("%")[0].split(" ")[-1]) > 80

.github/workflows/coveralls.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ jobs:
3333
sudo cmake --install build-dir
3434
pip install ./python/
3535
name: Install basix
36-
- run: python3 -m pytest -n=auto --cov=symfem --durations=50 test/
36+
- run: python3 -m pytest -n=auto --cov=symfem test/ > .coveralls_output
3737
name: Run unit tests
3838
continue-on-error: true
39+
- name: Check coverage is over 80%
40+
run: python3 .github/scripts/coveralls_check.py
3941
- name: Upload to Coveralls
40-
if: ${{ github.repository == 'mscroggs/symfem' }}
42+
if: ${{ github.ref == 'ref/head/main' }}
4143
env:
4244
COVERALLS_REPO_TOKEN: ${{ secrets.coverall_token }}
4345
run: coveralls

.github/workflows/style-checks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ name: 🕶️ Style
22

33
on:
44
push:
5+
branches:
6+
- "**"
7+
pull_request:
8+
branches:
9+
- main
510

611
jobs:
712
style-checks:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ dist/
88
feast.egg-info/
99
docs/_build
1010
.coverage
11+
.coveralls_output
1112

1213
joss/build.sh
1314
joss/paper.pdf

0 commit comments

Comments
 (0)