generated from readthedocs/tutorial-template
-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (39 loc) · 1.15 KB
/
test-and-coverage.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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Unit tests
on:
push:
branches:
- main
paths-ignore:
- 'README.md'
- '.github/workflows/test-and-coverage.yml'
- 'docs/**'
pull_request:
paths-ignore:
- 'README.md'
- '.github/workflows/test-and-coverage.yml'
- 'docs/**'
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Build docker images
run: docker build . -t xspec-tests
- name: Test with pytest
run: docker run -t -v ./:/shared xspec-tests pytest --cov jaxspec --cov-report xml:/shared/coverage.xml
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true