-
Notifications
You must be signed in to change notification settings - Fork 62
189 lines (162 loc) · 4.3 KB
/
conda_env_test.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
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
name: CI
on:
schedule:
- cron: '45 01 30 * *'
push:
fork:
jobs:
test_utils:
name: Check utils
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: checkout
id: checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
enable-cache: true
cache-suffix: "uv"
cache-dependency-glob: "utils/requirements.txt"
- name: Create venv
run: uv venv my_env
- name: setup environment
id: setup
run: |
source my_env/bin/activate
uv pip install -r ./utils/requirements.txt
- name: list packages
id: list_pakcages
run: |
source my_env/bin/activate
uv pip list
- name: check utils
id: check_utils
run: |
source my_env/bin/activate
python -m pytest -n auto ./utils/tests/
badges:
name: Add Google Colab Badges
needs: test_utils
runs-on: ubuntu-latest
permissions:
contents: write
timeout-minutes: 5
steps:
- name: checkout
id: checkout
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
enable-cache: true
cache-suffix: "uv"
cache-dependency-glob: "utils/requirements.txt"
- name: Create venv
run: uv venv my_env
- name: setup environment
id: setup
run: |
source my_env/bin/activate
uv pip install -r ./utils/requirements.txt
- name: list packages
id: list_pakcages
run: |
source my_env/bin/activate
uv pip list
- name: Add/Update badges
id: badges
run: |
source my_env/bin/activate
python ./utils/add_colab_main_buttons.py
- name: Commit & push
id: commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message : "Clean ipynb ${{ github.sha }}"
test_ipynb:
needs: badges
name: ${{ matrix.anaconda }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
anaconda: ["2023.09", "nightly"]
fail-fast: false
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: setup conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
activate-environment: test-environment
environment-file: ./tests/environment.${{ matrix.anaconda }}.yml
use-only-tar-bz2: true
- name: pytest
env:
TEST_IPYNB_IGNORE_FOLDER: tutorial
run: |
conda env list
conda activate test-environment
conda list
python -m pytest --numprocesses=auto -k 'not (links or update_nmisp_py)' ./tests/
shell: bash -el {0}
test_ipynb_colab:
needs: badges
name: test ipynb on Google Colab
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.10.12'
- name: Install uv
uses: astral-sh/setup-uv@v3
with:
version: "latest"
enable-cache: true
cache-suffix: "uv"
cache-dependency-glob: "tests/requirements.colab.2024.02.txt"
- name: Create venv
run: uv venv my_env
- name: setup environment
id: setup
run: |
source my_env/bin/activate
uv pip install -r ./tests/requirements.colab.2024.02.txt
- name: list packages
id: list_pakcages
run: |
source my_env/bin/activate
uv pip list
- name: pytest
env:
TEST_IPYNB_IGNORE_FOLDER: tutorial
run: |
source my_env/bin/activate
python -m pytest -n auto -k 'not (links or update_nmisp_py)' ./tests
update_nmisp_py:
needs: [test_ipynb, test_ipynb_colab]
name: Update nmisp_py
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: checkout
id: checkout
uses: actions/checkout@v4
- name: setup python
uses: actions/setup-python@v5
with:
python-version: '3.10.12'
cache: 'pip'
- name: run nmisp_py updater
id: updater
env:
LOGIN_INFO: ${{ secrets.LOGIN_INFO }}
run: python ./utils/update_nmisp_py.py