Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/draft-pdf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,17 @@ jobs:
name: Paper Draft
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Build draft PDF
uses: openjournals/openjournals-draft-action@master
uses: openjournals/openjournals-draft-action@85a18372e48f551d8af9ddb7a747de685fbbb01c # v1.0
with:
journal: joss
# This should be the path to the paper within your repo.
paper-path: papers/joss/paper.md
- name: Upload
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: paper
# This is the output path where Pandoc will write the compiled
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/lychee_links.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,19 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Restore lychee cache
uses: actions/cache@v4
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
with:
path: .lycheecache
key: cache-lychee-${{ github.sha }}
restore-keys: cache-lychee-

- name: Run lychee
uses: lycheeverse/lychee-action@v2
uses: lycheeverse/lychee-action@a8c4c7cb88f0c7386610c35eb25108e448569cb0 # v2.7.0
with:
args: >-
--cache
Expand Down
97 changes: 50 additions & 47 deletions .github/workflows/nightly_dependency_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,75 +14,78 @@ concurrency:
# Cancel in-progress runs when a new workflow with the same group name is triggered
cancel-in-progress: true

permissions: {}

jobs:
check_latest_dependencies:
check_dependencies:
name: Test-${{ matrix.dep-type }}-${{ matrix.os }}-py-${{ matrix.python-version }}-${{ matrix.suite }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
python-version: ["3.12"]
os: [ubuntu-latest, macos-latest]
suite: ["unit", "integration", "examples", "notebooks"]

name: Test-${{ matrix.os }}-py-${{ matrix.python-version }}-${{ matrix.suite }})
dep-type: ["latest", "lowest"]
# The following must remain in sync with our Python version support as defined in pyproject.toml
include:
# Latest dependencies with Python 3.13 (our maximum supported Python version)
- dep-type: latest
python-version: "3.13"
# Lowest dependencies with Python 3.10 (our minimum supported Python version)
- dep-type: lowest
python-version: "3.10"
permissions:
contents: read
issues: write # for creating issues when tests fail

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install -e .[all,dev]
python -m pip uninstall -y pybamm
python -m pip install "pybamm[all] @ git+https://github.com/pybamm-team/PyBaMM@main"


- name: Run ${{ matrix.suite }} tests
run: |
if [[ "${{ matrix.suite }}" == "unit" ]]; then
python -m pytest --unit
elif [[ "${{ matrix.suite }}" == "integration" ]]; then
python -m pytest --integration
elif [[ "${{ matrix.suite }}" == "examples" ]]; then
python -m pytest --examples
elif [[ "${{ matrix.suite }}" == "notebooks" ]]; then
python -m pytest --notebooks --nbmake --nbmake-timeout=1000 examples/
fi
persist-credentials: false

check_lowest_dependencies:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-14]
python-version: ["3.10"]
suite: ["unit", "integration", "examples", "notebooks"]

name: Test-${{ matrix.os }}-py-${{ matrix.python-version }}-${{ matrix.suite }})

steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v7
uses: astral-sh/setup-uv@eac588ad8def6316056a12d4907a9d4d84ff7a3b # v7.3.0
with:
python-version: ${{ matrix.python-version }}
activate-environment: "true"
- name: Install dependencies

- name: Install dependencies (latest)
if: matrix.dep-type == 'latest'
run: |
uv pip install -e .[all,dev]
uv pip uninstall -y pybamm
uv pip install "pybamm[all] @ git+https://github.com/pybamm-team/PyBaMM@main"
uv pip install pytest-reportlog

- name: Install dependencies (lowest)
if: matrix.dep-type == 'lowest'
run: |
uv pip install -e .[dev]
uv pip install --resolution lowest-direct -e .[all]

uv pip install pytest-reportlog

- name: Run ${{ matrix.suite }} tests
id: pytest
env:
PYTEST: "pytest --report-log=pytest-log.jsonl"
run: |
if [[ "${{ matrix.suite }}" == "unit" ]]; then
python -m pytest --unit
python -m $PYTEST --unit
elif [[ "${{ matrix.suite }}" == "integration" ]]; then
python -m pytest --integration
python -m $PYTEST --integration
elif [[ "${{ matrix.suite }}" == "examples" ]]; then
python -m pytest --examples
python -m $PYTEST --examples
elif [[ "${{ matrix.suite }}" == "notebooks" ]]; then
python -m pytest --notebooks --nbmake --nbmake-timeout=1000 examples/
python -m $PYTEST --notebooks --nbmake --nbmake-timeout=1000 examples/
fi

- name: Create issues from pytest logs
uses: scientific-python/issue-from-pytest-log-action@558a3dfdd251069b328d3fded994824ddbefc47b # v1.4.0
if: |
failure()
&& steps.pytest.outcome == 'failure'
&& github.repository == 'pybop-team/PyBOP'
&& github.event_name == 'schedule'
with:
log-path: pytest-log.jsonl
issue-title: "Nightly ${{ matrix.dep-type }} dependencies ${{ matrix.suite }} tests failed (${{ matrix.os }} Python ${{ matrix.python-version }})"
12 changes: 7 additions & 5 deletions .github/workflows/periodic_benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ jobs:
rm -rf ./* || true
rm -rf ./.??* || true

- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Install python & create virtualenv
shell: bash
Expand All @@ -47,7 +49,7 @@ jobs:
python -m asv run --machine "SelfHostedRunner" NEW --show-stderr -v

- name: Upload results as artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: asv_periodic_results
path: results
Expand All @@ -67,21 +69,21 @@ jobs:
if: github.repository == 'pybop-team/PyBOP'
steps:
- name: Set up Python 3.12
uses: actions/setup-python@v5
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: 3.12

- name: Install asv
run: pip install asv

- name: Checkout pybop-bench repo
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: pybop-team/pybop-bench
token: ${{ secrets.PUSH_BENCH_TOKEN }}

- name: Download results artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: asv_periodic_results
path: new_results
Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/release_action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.12"
- name: Build a source tarball and a wheel from it
run: pipx run build
- name: Store the distribution packages
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
with:
name: python-package-distributions
path: dist/
Expand All @@ -40,13 +42,13 @@ jobs:

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: python-package-distributions
path: dist/
merge-multiple: true
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

github-release:
name: >-
Expand All @@ -62,19 +64,19 @@ jobs:

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: python-package-distributions
path: dist/
merge-multiple: true
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v1.2.3
uses: sigstore/gh-action-sigstore-python@a5caf349bc536fbef3668a10ed7f5cd309a4b53d # v3.2.0
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Publish artifacts and signatures to GitHub Releases
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
with:
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
Expand All @@ -97,12 +99,12 @@ jobs:

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
with:
name: python-package-distributions
path: dist/
merge-multiple: true
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
with:
repository-url: https://test.pypi.org/legacy/
14 changes: 10 additions & 4 deletions .github/workflows/scheduled_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out PyBOP repository
uses: actions/checkout@v4
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
sparse-checkout-cone-mode: false
sparse-checkout: |
scripts/ci/build_matrix.sh
Expand Down Expand Up @@ -82,9 +83,11 @@ jobs:
PYBAMM_VERSION: ${{ matrix.pybamm_version }}

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python_version }}
uses: actions/setup-python@v4
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python_version }}

Expand Down Expand Up @@ -125,7 +128,10 @@ jobs:
rm -rf ./* || true
rm -rf ./.??* || true

- uses: actions/checkout@v4
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false

- name: Install python & create virtualenv
shell: bash
run: |
Expand Down
Loading