-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (46 loc) · 1.18 KB
/
ci_test.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
name: CI Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
CI:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: 3.9
- name: Checkout this Repo
uses: actions/checkout@v3
with:
path: pyadic
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov
pip install -e pyadic
- name: Test with pytest
run: |
cd pyadic
pytest |& tee coverage.txt
PYTEST_EXIT_CODE=${PIPESTATUS[0]}
if [ "$PYTEST_EXIT_CODE" -ne 0 ]; then
echo "pytest failed with exit code $PYTEST_EXIT_CODE"
exit 1
else
echo "pytest passed with exit code 0"
fi
- name: Run update-badges script
run: |
cd pyadic
python update-badges.py
- name: Update badges and commit README.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
file_pattern: README.md
repository: pyadic
commit_message: "Automatic badge update"