Skip to content

40 / 40 : just in case #937

40 / 40 : just in case

40 / 40 : just in case #937

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