Skip to content

Commit

Permalink
pybop-team#123 run script, pass generated matrix to next job
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Feb 11, 2024
1 parent bff90d6 commit 4f64bd4
Showing 1 changed file with 27 additions and 11 deletions.
38 changes: 27 additions & 11 deletions .github/workflows/scheduled_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,36 @@ on:
- 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:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11"]
matrix: ${{fromJson(needs.create_pybamm_matrix.outputs.pybop_matrix)}}

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
python-version: ${{ matrix.python_version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip nox
Expand All @@ -33,30 +49,30 @@ jobs:
python -m nox -s unit
python -m nox -s notebooks
#M-series Mac Mini
# 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"]
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 }}
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 }}
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
Expand All @@ -66,5 +82,5 @@ jobs:
shell: bash
run: |
eval "$(pyenv init -)"
pyenv activate pybop-${{ matrix.python-version }}
pyenv activate pybop-${{ matrix.python_version }}
pyenv uninstall -f $( python --version )

0 comments on commit 4f64bd4

Please sign in to comment.