-
Notifications
You must be signed in to change notification settings - Fork 7
60 lines (51 loc) · 1.51 KB
/
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
51
52
53
54
55
56
57
58
59
60
name: test
on:
push:
branches: # on all branches except `typos`
- '**'
- '!typos'
paths-ignore:
- 'docs/**'
- 'notebooks/**'
- 'paper/**'
- '.git*'
- 'README.md'
pull_request:
branches:
- '**'
schedule: # Every Monday at 07:00 UTC, 00:00 PT
- cron: '0 7 * * 1'
jobs:
build:
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11" ]
os: [ubuntu-latest]
fail-fast: false
name: Python ${{ matrix.python-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@master
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install .
python -c 'import cerf; cerf.install_package_data()'
- name: Test and generate coverage report
run: |
pip install pytest
pip install pytest-cov
pytest --cov=./ --cov-report=xml
- uses: codecov/codecov-action@v4
with:
files: ./coverage.xml # optional
name: codecov-umbrella # optional
token: ${{ secrets.CODECOV_TOKEN }} # required
- name: Notify on failure
if: failure() # This step will only run if any previous step fails
run: |
echo "Build or tests failed. Please check the logs."