Download IDAKLU from pybammsolvers #11373
Workflow file for this run
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: PyBaMM | |
on: | |
workflow_dispatch: | |
pull_request: | |
env: | |
PYBAMM_DISABLE_TELEMETRY: "true" | |
FORCE_COLOR: 3 | |
concurrency: | |
# github.workflow: name of the workflow, so that we don't cancel other workflows | |
# github.event.pull_request.number || github.ref: pull request number or branch name if not a pull request | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
# Cancel in-progress runs when a new workflow with the same group name is triggered | |
# This avoids workflow runs on both pushes and PRs | |
cancel-in-progress: true | |
jobs: | |
style: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup Python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: 3.12 | |
- name: Set up uv | |
run: python -m pip install uv | |
- name: Check style | |
run: | | |
python -m uv pip install pre-commit | |
pre-commit run -a | |
run_unit_integration_and_coverage_tests: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-13, macos-14, windows-latest] | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
name: Tests (${{ matrix.os }} / Python ${{ matrix.python-version }}) | |
steps: | |
- name: Check out PyBaMM repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install Linux system dependencies | |
uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2 | |
if: matrix.os == 'ubuntu-latest' | |
with: | |
packages: gfortran gcc graphviz pandoc | |
execute_install_scripts: true | |
# dot -c is for registering graphviz fonts and plugins | |
- name: Install OpenBLAS and TeXLive for Linux | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get update | |
sudo dot -c | |
sudo apt-get install libopenblas-dev texlive-latex-extra dvipng | |
- name: Install macOS system dependencies | |
if: matrix.os == 'macos-13' || matrix.os == 'macos-14' | |
env: | |
HOMEBREW_NO_INSTALL_CLEANUP: 1 | |
HOMEBREW_NO_AUTO_UPDATE: 1 | |
HOMEBREW_NO_COLOR: 1 | |
# Speed up CI | |
NONINTERACTIVE: 1 | |
# sometimes gfortran cannot be found, so reinstall gcc just to be sure | |
run: | | |
brew analytics off | |
brew install graphviz libomp | |
brew reinstall gcc | |
- name: Install Windows system dependencies | |
if: matrix.os == 'windows-latest' | |
run: choco install graphviz --version=8.0.5 | |
- name: Set up Python ${{ matrix.python-version }} | |
id: setup-python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: 'pip' | |
- name: Set up uv | |
run: python -m pip install uv | |
- name: Install nox | |
run: python -m uv pip install nox[uv] | |
- name: Run unit tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} | |
if: matrix.os != 'ubuntu-latest' || matrix.python-version != '3.12' | |
run: python -m nox -s unit | |
- name: Run coverage tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' | |
run: python -m nox -s coverage | |
- name: Upload coverage report | |
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12' | |
uses: codecov/codecov-action@1e68e06f1dbfde0e4cefc87efeba9e4643565303 # v5.1.2 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
- name: Run integration tests for ${{ matrix.os }} with Python ${{ matrix.python-version }} | |
run: python -m nox -s integration | |
run_doctests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
name: Doctests (ubuntu-latest / Python 3.11) | |
steps: | |
- name: Check out PyBaMM repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 | |
- name: Install Linux system dependencies | |
uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2 | |
with: | |
packages: graphviz pandoc | |
execute_install_scripts: true | |
# dot -c is for registering graphviz fonts and plugins | |
- name: Install TeXLive for Linux | |
run: | | |
sudo apt-get update | |
sudo dot -c | |
sudo apt-get install texlive-latex-extra dvipng | |
- name: Set up Python | |
id: setup-python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: 3.11 | |
cache: 'pip' | |
- name: Set up uv | |
run: python -m pip install uv | |
- name: Install nox | |
run: python -m uv pip install nox[uv] | |
- name: Install docs dependencies and run doctests for GNU/Linux | |
run: python -m nox -s doctests | |
- name: Check if the documentation can be built for GNU/Linux | |
run: python -m nox -s docs | |
run_example_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
name: Example notebooks (ubuntu-latest / Python 3.12) | |
steps: | |
- name: Check out PyBaMM repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install Linux system dependencies | |
uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2 | |
with: | |
packages: gfortran gcc graphviz pandoc | |
execute_install_scripts: true | |
# dot -c is for registering graphviz fonts and plugins | |
- name: Install OpenBLAS and TeXLive for Linux | |
run: | | |
sudo apt-get update | |
sudo dot -c | |
sudo apt-get install libopenblas-dev texlive-latex-extra dvipng | |
- name: Set up Python 3.12 | |
id: setup-python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: 3.12 | |
cache: 'pip' | |
- name: Set up uv | |
run: python -m pip install uv | |
- name: Install nox | |
run: python -m uv pip install nox[uv] | |
- name: Run example notebooks tests for GNU/Linux with Python 3.12 | |
run: python -m nox -s examples | |
run_scripts_tests: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
name: Example scripts (ubuntu-latest / Python 3.12) | |
steps: | |
- name: Check out PyBaMM repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Install Linux system dependencies | |
uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2 | |
with: | |
packages: gfortran gcc graphviz | |
execute_install_scripts: true | |
# dot -c is for registering graphviz fonts and plugins | |
- name: Install OpenBLAS and TeXLive for Linux | |
run: | | |
sudo apt-get update | |
sudo dot -c | |
sudo apt-get install libopenblas-dev texlive-latex-extra dvipng | |
- name: Set up Python 3.12 | |
id: setup-python | |
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 | |
with: | |
python-version: 3.12 | |
cache: 'pip' | |
- name: Set up uv | |
run: python -m pip install uv | |
- name: Install nox | |
run: python -m uv pip install nox[uv] | |
- name: Run example scripts tests for GNU/Linux with Python 3.12 | |
run: python -m nox -s scripts |