CI #65
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
schedule: | |
- cron: '30 3 12 * *' | |
push: | |
fork: | |
jobs: | |
test_links_utils: | |
name: Check links in ipynb | |
runs-on: ubuntu-latest | |
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 pytest pytest-xdist requests jupyter lxml numpy matplotlib scipy sympy | |
- name: check links | |
id: links | |
run: python -m pytest -n auto ./tests/test_check_links_in_ipynb.py ./utils/tests/ | |
badges: | |
name: Add Google Colab Badges | |
needs: test_links_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, macOS-latest, windows-latest] | |
anaconda: ["2021.11"] | |
fail-fast: false | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build environment | |
env: | |
CONDA_PYTHON: ${{ matrix.anaconda }} | |
run: bash ./.github/workflows/build_env.sh | |
- name: pytest | |
env: | |
TEST_IPYNB_IGNORE_FOLDER: tutorial | |
run: bash ./.github/workflows/run_test.sh | |
test_ipynb_nightly: | |
needs: badges | |
name: ${{ matrix.anaconda }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macOS-latest, windows-latest] | |
anaconda: [nightly] | |
fail-fast: false | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: build environment | |
env: | |
CONDA_PYTHON: ${{ matrix.anaconda }} | |
run: bash ./.github/workflows/build_env.sh | |
- name: pytest | |
env: | |
TEST_IPYNB_IGNORE_FOLDER: tutorial | |
run: bash ./.github/workflows/run_test.sh | |
test_ipynb_colab: | |
needs: badges | |
name: test ipynb on Google Colab | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9.16' | |
- 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.2023.04.txt') }} | |
- name: install dependencies | |
run: python -m pip install -r ./tests/requirements.colab.2023.04.txt | |
- name: pytest | |
env: | |
TEST_IPYNB_IGNORE_FOLDER: tutorial | |
run: python -m pytest -n auto -k 'not (links or update_nmisp_py)' ./tests |