generated from benchopt/template_benchmark
-
Notifications
You must be signed in to change notification settings - Fork 4
157 lines (135 loc) · 3.85 KB
/
main.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
name: Tests
on:
push:
branches:
- main
create:
tags:
- '**'
pull_request:
branches:
- main
schedule:
# Run every day at 7:42am UTC.
- cron: '42 7 * * *'
jobs:
test-benchmark:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
- os: macos-latest
env:
CONDA_ENV: 'test_env'
VERSION_PYTHON: ${{ matrix.version_python }}
BENCHOPT_BRANCH: benchopt:main
BENCHOPT_DEBUG: 1
BENCHOPT_CONDA_CMD: mamba
defaults:
run:
# Need to use this shell to get conda working properly.
# See https://github.com/marketplace/actions/setup-miniconda#important
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Cache datasets
uses: actions/cache@v3
env:
cache-name: cache-datasets-v2
with:
path: |
data
~/tensorflow_datasets
key: build-${{ env.cache-name }}
restore-keys: |
build-${{ env.cache-name }}
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ${{ env.CONDA_ENV }}
python-version: 3.8
# Use miniforge to only get conda-forge as default channel.
miniforge-version: latest
- run: conda info
- name: Install benchopt and its dependencies
run: |
conda info
conda install -yq pip
# Get the correct branch of benchopt
user=${BENCHOPT_BRANCH%:*}
branch=${BENCHOPT_BRANCH##*:}
pip install -U git+https://github.com/$user/benchopt@$branch
conda install -c conda-forge mamba
- name: Test
run: |
benchopt test . --env-name bench_test_env -vl
benchopt test . --env-name bench_test_env -vl --skip-install
linter-flake8:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Lint with flake8
run: |
pip install flake8
flake8 .
benchmark-tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
- os: macos-latest
env:
CONDA_ENV: 'test_env'
VERSION_PYTHON: ${{ matrix.version_python }}
BENCHOPT_BRANCH: benchopt:main
BENCHOPT_DEBUG: 1
BENCHOPT_CONDA_CMD: mamba
LD_LIBRARY_PATH: /usr/share/miniconda3/lib:/usr/share/miniconda3/envs/test_env/lib:$LD_LIBRARY_PATH
defaults:
run:
# Need to use this shell to get conda working properly.
# See https://github.com/marketplace/actions/setup-miniconda#important
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Cache datasets
uses: actions/cache@v3
env:
cache-name: cache-datasets
with:
path: |
data
~/tensorflow_datasets
key: build-${{ env.cache-name }}
restore-keys: |
build-${{ env.cache-name }}
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: ${{ env.CONDA_ENV }}
python-version: 3.8
# Use miniforge to only get conda-forge as default channel.
miniforge-version: latest
- run: conda info
- name: Install benchopt and its dependencies
run: |
conda info
conda install -yq pip
# Get the correct branch of benchopt
user=${BENCHOPT_BRANCH%:*}
branch=${BENCHOPT_BRANCH##*:}
pip install -U git+https://github.com/$user/benchopt@$branch
conda install -c conda-forge mamba
- name: install test dependencies
run: |
mamba install -c conda-forge --file=test_torch_requirements.txt
pip install -r test_tf_requirements.txt
- name: Test
run: |
pytest