Skip to content

Scheduled

Scheduled #2

name: Scheduled
on:
workflow_dispatch:
pull_request:
branches:
- main
# runs every day at 09:00 UTC
schedule:
- cron: '0 9 * * *'
jobs:
# Dynamically create a matrix of OS, Python, and PyBaMM versions
create_pybamm_matrix:
runs-on: ubuntu-latest
outputs:
pybop_matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Check out PyBOP repository
uses: actions/checkout@v4
with:
path: .github/workflows/build_matrix.sh
- name: Dynamically create GitHub Actions matrix
id: set-matrix
run: |
bash .github/workflows/build_matrix.sh >> matrix_json
echo "matrix=$(cat matrix_json)" >> "$GITHUB_OUTPUT"
build:
needs: [create_pybamm_matrix]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix: ${{fromJson(needs.create_pybamm_matrix.outputs.pybop_matrix)}}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip nox
- name: Unit tests with nox
run: |
python -m nox -s unit
python -m nox -s notebooks
# M-series Mac Mini
build-apple-mseries:
runs-on: [self-hosted, macOS, ARM64]
env:
GITHUB_PATH: ${PYENV_ROOT/bin:$PATH}
strategy:
fail-fast: false
matrix:
python_version: ["3.10"]
steps:
- uses: actions/checkout@v4
- name: Install python & create virtualenv
shell: bash
run: |
eval "$(pyenv init -)"
pyenv install ${{ matrix.python_version }} -s
pyenv virtualenv ${{ matrix.python_version }} pybop-${{ matrix.python_version }}
- name: Install dependencies & run unit tests
shell: bash
run: |
eval "$(pyenv init -)"
pyenv activate pybop-${{ matrix.python_version }}
python -m pip install --upgrade pip wheel setuptools nox
python -m nox -s unit
python -m nox -s notebooks
- name: Uninstall pyenv-virtualenv & python
if: always()
shell: bash
run: |
eval "$(pyenv init -)"
pyenv activate pybop-${{ matrix.python_version }}
pyenv uninstall -f $( python --version )