Repository navigation
75 lines (69 loc) · 1.96 KB
/
Copy pathmain.yml
File metadata and controls
75 lines (69 loc) · 1.96 KB
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
name: tests
on:
push:
branches: main
pull_request:
branches: main
# Cancel superseded runs when new commits are pushed to a PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
pytest-common:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
matrix:
os: [ubuntu-latest]
python: ["3.11"]
steps:
- uses: actions/checkout@v7
- name: Setup environment
uses: ./.github/actions/setup-env
with:
python-version: ${{ matrix.python }}
extras: viz,html,testing
- name: Run unittests
run: pytest tests/common/ -rs --cov --cov-report=xml:coverage-common.xml
- uses: actions/upload-artifact@v7
with:
name: coverage-common
path: ./coverage-common.xml
if-no-files-found: error
pytest-torch:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
matrix:
os: [ubuntu-latest]
python: ["3.11"]
steps:
- uses: actions/checkout@v7
- name: Setup environment
uses: ./.github/actions/setup-env
with:
python-version: ${{ matrix.python }}
extras: viz,html,testing
cache-compile: "true"
- name: Run unittests
run: pytest tests/pytorch/ -rs --cov --cov-report=xml:coverage-pt.xml
- uses: actions/upload-artifact@v7
with:
name: coverage-pytorch
path: ./coverage-pt.xml
if-no-files-found: error
codecov-upload:
runs-on: ubuntu-latest
timeout-minutes: 10
needs: [ pytest-common, pytest-torch ]
steps:
- uses: actions/checkout@v7
- uses: actions/download-artifact@v8
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
flags: unittests
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}