-
-
Notifications
You must be signed in to change notification settings - Fork 142
61 lines (51 loc) · 1.92 KB
/
testing.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
61
name: Testing
on:
push:
branches: [main]
pull_request: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
pytest:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10"]
include:
- { os: "ubuntu-20.04", python-version: "3.8", requires: "oldest" }
- { os: "ubuntu-20.04", python-version: "3.9", requires: "oldest" }
env:
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set min. dependencies
if: matrix.requires == 'oldest'
run: |
import os
fname = 'requirements/base.txt'
lines = [line.replace('>=', '==') for line in open(fname).readlines()]
open(fname, 'w').writelines(lines)
shell: python
- name: Install main package & dependencies
run: |
pip install -e .[extra] -r requirements/dev.txt -f ${TORCH_URL}
pip list
- name: Restore test's datasets
uses: actions/cache/restore@v4
with:
path: tests/.datasets
key: test-datasets
- name: Run test-suite
run: python -m pytest -v
- name: Save test's datasets
uses: actions/cache/save@v4
with:
path: tests/.datasets
key: test-datasets