-
Notifications
You must be signed in to change notification settings - Fork 60
165 lines (136 loc) · 3.83 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
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: Update pip
run: python -m pip install --upgrade pip
- name: Create venv
run: python -m venv venv
- name: Activate venv
run: source venv/bin/activate
- name: Cache venv
uses: actions/cache@v4
with:
path: venv
key: ${{ runner.os }}-${{ hashFiles('./utils/requirements.txt') }}
- name: setup environment
id: setup
run: python -m pip install -r ./utils/requirements.txt
- name: list packages
id: list_pakcages
run: python -m pip list
- name: check utils
id: check_utils
run: 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: Update pip
run: python -m pip install --upgrade pip
- name: setup environment
id: setup
run: python -m pip install bs4 jupyter lxml
- name: Add/Update badges
id: badges
run: 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: Update pip
run: python -m pip install --upgrade pip
- name: Create venv
run: python -m venv venv
- name: Activate venv
run: source venv/bin/activate
- name: Cache venv
uses: actions/cache@v4
with:
path: venv
key: ${{ runner.os }}-${{ hashFiles('./tests/requirements.colab.2024.02.txt') }}
- name: install dependencies
run: python -m pip install -r ./tests/requirements.colab.2024.02.txt
- name: pytest
env:
TEST_IPYNB_IGNORE_FOLDER: tutorial
run: 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: Update pip
run: python -m pip install --upgrade pip
- name: run nmisp_py updater
id: updater
env:
LOGIN_INFO: ${{ secrets.LOGIN_INFO }}
run: python ./utils/update_nmisp_py.py