forked from OpenMined/PySyft
-
Notifications
You must be signed in to change notification settings - Fork 1
221 lines (190 loc) · 6.68 KB
/
syft-version_tests.yml
File metadata and controls
221 lines (190 loc) · 6.68 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
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
# Version Tests
# To speed up development we don't run all the tests when opening and updating a PR.
# This test will run older versions of things like Python and Torch nightly so that
# we don't consume a lot of extra actions when we don't need to. It's important to
# keep this in sync with pr_tests.yml so that they are essentially doing the same thing
# only this runs on a schedule.
name: Syft Version Tests
on:
schedule:
- cron: "0 22 * * *" # 7pm Brazil, 10pm UTC, 8am AEST
push:
branches:
- dev
paths:
- "packages/syft/tests/trigger/version_tests"
workflow_dispatch:
inputs:
none:
description: "Run Version Tests Manually"
required: false
defaults:
run:
working-directory: ./packages/syft
jobs:
python-tests-all-versions:
strategy:
fail-fast: false
max-parallel: 99
matrix:
branches: ["dev"]
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
torch-version: [1.6.0, 1.7.1, 1.8.1]
exclude:
- python-version: 3.9
torch-version: 1.6.0
- python-version: 3.9
torch-version: 1.7.1
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ matrix.branches }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
pip install --upgrade --user pip
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('./setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- name: Install Dependencies
run: |
pip install packaging --default-timeout=60
python scripts/adjust_torch_versions.py ./setup.cfg ${{ matrix.torch-version }}
grep -A 3 "torch_ecosystem" setup.cfg
pip install -r requirements.unstable.txt
pip install -e .[ci-all] -f https://download.pytorch.org/whl/torch_stable.html
python scripts/parse_setup.py setup.cfg | xargs pip install --no-deps || true
- name: Scan for security issues
run: |
bandit -r src
safety check
- name: Run normal tests
run: |
pytest -m 'fast or slow' --cov syft --cov-fail-under 80 -n auto
- name: Install libomp for XGBoost
if: startsWith(runner.os, 'macos')
run: |
brew install libomp
- name: Run supported library tests
run: |
pytest -m libs --co
pytest -m libs -n auto -k "not tenseal" --suppress-no-test-exit-code
pytest -m libs -n 1 -k "tenseal" --suppress-no-test-exit-code
pygrid-integration-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 4
matrix:
branches: ["dev"]
python-version: [3.7, 3.8, 3.9]
torch-version: [1.8.1]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ matrix.branches }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
pip install --upgrade --user pip
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('./setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- uses: actions/checkout@v2
with:
repository: "OpenMined/PyGrid"
ref: "dev"
path: "packages/grid"
- name: Install Dependencies
run: |
pip install packaging --default-timeout=60
python scripts/adjust_torch_versions.py ./setup.cfg ${{ matrix.torch-version }}
grep -A 3 "torch_ecosystem" setup.cfg
pip install -r requirements.unstable.txt
pip install -e .[ci-all] -f https://download.pytorch.org/whl/torch_stable.html
python scripts/parse_setup.py setup.cfg | xargs pip install --no-deps || true
- name: Test PyGrid
continue-on-error: true
run: |
pytest ../grid/apps/domain/tests
pytest ../grid/apps/network/tests
pytest ../grid/apps/worker/tests
python ./scripts/mnist.py
pytest -m grid
pytorch-tests-all-versions:
strategy:
fail-fast: false
max-parallel: 99
matrix:
branches: ["dev"]
os: [windows-latest, ubuntu-latest, macos-latest]
python-version: [3.7, 3.8, 3.9]
torch-version: [1.6.0, 1.7.1, 1.8.1]
exclude:
- python-version: 3.9
torch-version: 1.6.0
- python-version: 3.9
torch-version: 1.7.1
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ matrix.branches }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
pip install --upgrade --user pip
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: pip cache
uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-py${{ matrix.python-version }}-${{ hashFiles('./setup.cfg') }}
restore-keys: |
${{ runner.os }}-pip-py${{ matrix.python-version }}-
- name: Install Dependencies
run: |
pip install packaging --default-timeout=60
python scripts/adjust_torch_versions.py ./setup.cfg ${{ matrix.torch-version }}
grep -A 3 "torch_ecosystem" setup.cfg
pip install -r requirements.unstable.txt
pip install -e .[dev] -f https://download.pytorch.org/whl/torch_stable.html
- name: Check import works without dev packages
run: |
python -c "import syft"
- name: Run torch tests
run: |
pytest -m torch -n auto -p no:benchmark