-
Notifications
You must be signed in to change notification settings - Fork 42
143 lines (139 loc) · 4.71 KB
/
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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
name: Tests
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
python: 3.7
torch: 1.9.0+cpu
torch-source: https://download.pytorch.org/whl/torch_stable.html
- os: ubuntu-latest
python: 3.8
torch: 1.9.0+cpu
torch-source: https://download.pytorch.org/whl/torch_stable.html
slow: True
- os: ubuntu-latest
python: 3.9
torch: 1.9.0+cpu
torch-source: https://download.pytorch.org/whl/torch_stable.html
- os: ubuntu-latest
python: "3.10"
torch: 1.13.1+cpu
torch-source: https://download.pytorch.org/whl/torch_stable.html
- os: macos-11
python: 3.7
torch: 1.9.0
torch-source: https://download.pytorch.org/whl/torch_stable.html
- os: macos-11
python: 3.8
torch: 1.9.0
torch-source: https://download.pytorch.org/whl/torch_stable.html
conda: True
- os: macos-11
python: 3.9
torch: 1.9.0
torch-source: https://download.pytorch.org/whl/torch_stable.html
- os: windows-latest
python: 3.8
torch: 1.9.0+cpu
torch-source: https://download.pytorch.org/whl/torch_stable.html
env:
DEBUG: 1
# DEVELOPER_DIR: /Applications/Xcode_12.4.app/Contents/Developer
steps:
- run: ls -n /Applications/ | grep Xcode*
if: matrix.os == 'macos-11'
- uses: actions/checkout@v3
- name: Data setup
if: matrix.slow
run: |
wget -q https://github.com/vita-epfl/trajnetplusplusdata/releases/download/v4.0/train.zip
mkdir data-trajnet
unzip train.zip -d data-trajnet
- name: Set up Python ${{ matrix.python }}
if: ${{ !matrix.conda }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Set up Conda
if: matrix.conda
uses: s-weigand/setup-conda@v1
with:
update-conda: true
python-version: ${{ matrix.python }}
conda-channels: anaconda, conda-forge
- run: conda --version
if: matrix.conda
- run: which python
if: matrix.conda
- run: python --version
- name: Install pre-requisites
run: |
python -m pip install --upgrade pip setuptools wheel
python -m pip install torch==${{ matrix.torch }} -f ${{ matrix.torch-source }}
- name: Install
run: |
echo ${DEBUG}
python -m pip install -e ".[dev,plot]" --no-build-isolation
- name: Install ffmpeg for Guide test
uses: FedericoCarboni/setup-ffmpeg@v1
if: matrix.slow
id: setup-ffmpeg
- name: ffmpeg codecs
if: matrix.slow
run: ffmpeg -codecs
- name: Print environment
run: |
python -m pip freeze
python --version
python -c "import socialforce; print(socialforce.__version__)"
- name: Lint socialforce
run: |
pylint socialforce --disable=fixme
- name: Lint tests
if: matrix.os != 'windows-latest' # because of path separator
run: |
pylint tests/test_*.py --disable=fixme
- name: pycodestyle socialforce
run: |
python -m pycodestyle socialforce
- name: pycodestyle tests
if: matrix.os != 'windows-latest' # because of path separator
run: |
python -m pycodestyle tests/test_*.py
- name: Check notebook formats and tags
if: matrix.slow
run: |
cd guide
python nb_cell_tags.py # runs all notebooks through nbformat
git status
git diff
git diff-index --quiet HEAD # exit code 1 when files were changed
- name: Check that notebook outputs are stripped
if: matrix.slow
run: |
cd guide
nbstripout *.ipynb
git status
git diff
git diff-index --quiet HEAD # exit code 1 when files were changed
- name: Lint and pycodestyle on notebooks
if: matrix.slow
run: |
mkdir guide_py
jupyter nbconvert --to=script --output-dir=./guide_py ./guide/*.ipynb
pylint ./guide_py/*.py --disable=trailing-whitespace,trailing-newlines,line-too-long,pointless-statement,undefined-variable,expression-not-assigned,wrong-import-position,ungrouped-imports,wrong-import-order,invalid-name
pycodestyle guide_py/*.py --ignore=W291,W391,E302,E305,E402,E501
- name: Test
env:
PYTHONDEVMODE: 1
run: |
pytest -vv -m "not slow"
- name: Test guide
if: matrix.slow
timeout-minutes: 45
run: |
cd guide && pytest --nbval-lax --current-env *.ipynb && cd ..