-
Notifications
You must be signed in to change notification settings - Fork 17
44 lines (36 loc) · 1.22 KB
/
python-tests.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
# This workflow will install Python dependencies,
# then run tests over a variety of Python versions.
name: tests
on: [pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] # [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# -- caching actually slows down the action!
# cache: 'pip'
# cache-dependency-path: |
# requirements*.txt
- name: Install dependencies
# torchsort needs torch first
run: |
python3 -m pip install --upgrade pip
python3 -m pip install "torch>=2.0.0"
python3 -m pip install -r requirements-test.txt
- name: Test with pytest
run: |
python3 -m pytest --cov=disent tests/
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
# codecov automatically merges all generated files
# if: matrix.os == 'ubuntu-latest' && matrix.python-version == 3.9