-
Notifications
You must be signed in to change notification settings - Fork 4
164 lines (139 loc) · 4.66 KB
/
validate-pr.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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: pr-validation
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
pr-validation:
name: test-py-${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
python: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
path: substrafl
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('substrafl/pyproject.toml') }}-${{ hashFiles ('substrafl/docs/requirements.txt') }}-${{ hashFiles('substrafl/benchmark/camelyon/requirements.txt') }}
- name: Install lint checks
run: |
pip install --upgrade pip
pip install --upgrade pytest black flake8 pre-commit
- name: Code conventions
run: |
cd substrafl
pre-commit run --all-files
- uses: actions/checkout@v4
with:
repository: substra/substra-tools
path: substratools
- uses: actions/checkout@v4
with:
repository: substra/substra
path: substra
- name: Install package
run: |
pip install --upgrade -e substrafl[dev]
pip install --upgrade -e substra
pip install --upgrade -e substratools
- name: Run the fast local tests
run: |
cd substrafl
make COV_OPTIONS="--cov=substrafl --cov-append --cov-report=html:htmlcov" test-subprocess-fast
- name: Upload coverage artifacts
uses: actions/upload-artifact@v3
with:
name: coverage
path: substrafl/htmlcov
pr-validation-docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('substrafl/pyproject.toml') }}-${{ hashFiles ('substrafl/docs/requirements.txt') }}-${{ hashFiles('substrafl/benchmark/camelyon/requirements.txt') }}
- uses: actions/checkout@v4
with:
repository: substra/substra
path: substra
- uses: actions/checkout@v4
with:
repository: substra/substra-tools
path: substratools
- name: Install Dependencies
run: |
pip install --upgrade ./substra
pip install --upgrade -e ./substratools
pip install --upgrade .[dev]
pip install --upgrade -r docs/requirements.txt
- name: Test docs
run: |
cd docs
make clean html
benchmark:
name: benchmark-${{ matrix.python }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
python: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/setup-python@v5
with:
python-version: 3.12
- uses: actions/checkout@v4
with:
path: substrafl
- uses: actions/checkout@v4
with:
repository: substra/substra-tools
path: substratools
- uses: actions/checkout@v4
with:
repository: substra/substra
path: substra
- uses: actions/[email protected]
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-${{ env.pythonLocation }}-pip-${{ hashFiles('substrafl/pyproject.toml') }}-${{ hashFiles ('substrafl/docs/requirements.txt') }}-${{ hashFiles('substrafl/benchmark/camelyon/requirements.txt') }}
- uses: actions/[email protected]
id: data
with:
path: /home/runner/work/substrafl/data
key: data
# The benchmark data cache has to be updated manually if the data changes
- name: Install package
run: |
pip install --upgrade -e substrafl[dev]
pip install --upgrade -e substra
pip install --upgrade -e substratools
pip install --upgrade -r substrafl/benchmark/camelyon/requirements.txt
- name: Run the local benchmark
run: |
cd substrafl
mkdir -p /home/runner/work/substrafl/data/tiles_0.5mpp
python benchmark/camelyon/benchmarks.py \
--mode subprocess \
--nb-train-data-samples 2 \
--nb-test-data-samples 2 \
--batch-size 4 \
--n-local-steps 1 \
--n-rounds 2 \
--data-path /home/runner/work/substrafl/data