Skip to content

Commit e640916

Browse files
committed
ci : update yaml recipes
remove *.sh files separate link checking and ipynb testing
1 parent 7020877 commit e640916

File tree

6 files changed

+57
-110
lines changed

6 files changed

+57
-110
lines changed

.github/workflows/build_env.sh

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/check_links.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Check Links
2+
3+
on:
4+
schedule:
5+
- cron: '45 01 30 * *'
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
test_links_utils:
11+
name: Check links in ipynb
12+
runs-on: ubuntu-latest
13+
timeout-minutes: 5
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.x'
22+
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
python -m pip install pytest pytest-xdist requests jupyter lxml numpy matplotlib scipy sympy
27+
28+
- name: Check links
29+
run: python -m pytest -n auto ./tests/test_check_links_in_ipynb.py ./utils/tests/
Lines changed: 28 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,63 @@
11
name: CI
22

33
on:
4-
schedule:
5-
- cron: '45 01 30 * *'
64
push:
7-
fork:
5+
pull_request:
6+
workflow_dispatch:
87

98
jobs:
10-
test_links_utils:
11-
name: Check links in ipynb
12-
runs-on: ubuntu-latest
13-
timeout-minutes: 5
14-
steps:
15-
- name: checkout
16-
id: checkout
17-
uses: actions/checkout@v4
18-
19-
- name: setup environment
20-
id: setup
21-
run: python -m pip install pytest pytest-xdist requests jupyter lxml numpy matplotlib scipy sympy
22-
23-
- name: check links
24-
id: links
25-
run: python -m pytest -n auto ./tests/test_check_links_in_ipynb.py ./utils/tests/
26-
279
badges:
2810
name: Add Google Colab Badges
29-
needs: test_links_utils
3011
runs-on: ubuntu-latest
3112
permissions:
3213
contents: write
3314
timeout-minutes: 5
3415
steps:
35-
- name: checkout
36-
id: checkout
16+
- name: Checkout
3717
uses: actions/checkout@v4
3818

39-
- name: Update pip
40-
run: python -m pip install --upgrade pip
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.x'
4123

42-
- name: setup environment
43-
id: setup
44-
run: python -m pip install bs4 jupyter lxml
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
python -m pip install bs4 jupyter lxml
4528
4629
- name: Add/Update badges
47-
id: badges
4830
run: python ./utils/add_colab_main_buttons.py
4931

5032
- name: Commit & push
51-
id: commit
5233
uses: stefanzweifel/git-auto-commit-action@v5
5334
with:
54-
commit_message : "Clean ipynb ${{ github.sha }}"
35+
commit_message: "Add Google Colab badges"
5536

5637
test_ipynb:
5738
needs: badges
58-
name: ${{ matrix.anaconda }} on ${{ matrix.os }}
59-
runs-on: ${{ matrix.os }}
39+
name: Test ipynb with Anaconda ${{ matrix.anaconda }}
40+
runs-on: ubuntu-latest
6041
strategy:
6142
matrix:
62-
os: [ubuntu-latest]
63-
anaconda: ["2021.11", nightly]
43+
anaconda: ["2021.11", "nightly"]
6444
fail-fast: false
6545
timeout-minutes: 30
6646
steps:
67-
- uses: actions/checkout@v4
47+
- name: Checkout
48+
uses: actions/checkout@v4
6849

69-
- name: build environment
70-
env:
71-
CONDA_PYTHON: ${{ matrix.anaconda }}
72-
run: bash ./.github/workflows/build_env.sh
50+
- name: Set up Miniconda
51+
uses: conda-incubator/setup-miniconda@v3
52+
with:
53+
auto-update-conda: true
54+
miniconda-version: "latest"
55+
environment-file: ./tests/environment.${{ matrix.anaconda }}.yml
56+
activate-environment: test-environment
7357

74-
- name: pytest
58+
- name: Run tests
59+
shell: bash -l {0}
7560
env:
7661
TEST_IPYNB_IGNORE_FOLDER: tutorial
77-
run: bash ./.github/workflows/run_test.sh
62+
run: |
63+
pytest --numprocesses=auto -k 'not (links or update_nmisp_py)' tests/

.github/workflows/run_test.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/set_os_env.sh

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/wget_install_miniconda.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)