-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add workflow to test PyBaMM develop branch nightly #291
Merged
BradyPlanden
merged 14 commits into
develop
from
290-test-nightly-against-pybamm-develop
Apr 18, 2024
Merged
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
03b833f
Add nightly pybamm@develop workflow
BradyPlanden 11aeef4
update CI name
BradyPlanden d9f133c
Updt for pip management, udpt CI names
BradyPlanden c239514
nightly_dependency_tests.yaml nox -> pytest
BradyPlanden 66b6e5d
bugfix pybamm uninstall
BradyPlanden 7c1bd0a
add dev optional pybop install
BradyPlanden cfca062
split tests, update pytest call for windows
BradyPlanden 9f20994
add continuation on fail
BradyPlanden 072ac2a
Updt to scheduled trigger
BradyPlanden 573f435
Update .github/workflows/nightly_dependency_tests.yaml
BradyPlanden 4366f8c
Apply suggestions from code review
BradyPlanden cefba15
Update deployment versions / OS, change to weekly on Monday, remove p…
BradyPlanden 5a7cbc4
Apply suggestions from code review
BradyPlanden 37f00e4
updt workflow name
BradyPlanden File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Nightly dependencies@develop | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 23 * * *" | ||
|
||
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 | ||
BradyPlanden marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
jobs: | ||
style: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.12 | ||
|
||
- name: Check formatting with pre-commit | ||
run: | | ||
python -m pip install pre-commit | ||
pre-commit run ruff | ||
|
||
Tests: | ||
needs: style | ||
BradyPlanden marked this conversation as resolved.
Show resolved
Hide resolved
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
# Include MacOS M-series Runners | ||
include: | ||
- os: macos-14 | ||
python-version: "3.10" | ||
- os: macos-14 | ||
python-version: "3.11" | ||
- os: macos-14 | ||
python-version: "3.12" | ||
BradyPlanden marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
name: Test Suite (${{ matrix.os }} / Python ${{ matrix.python-version }}) | ||
BradyPlanden marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 -e .[all,dev] | ||
python -m pip uninstall -y pybamm | ||
python -m pip install git+https://github.com/pybamm-team/PyBaMM.git@develop | ||
BradyPlanden marked this conversation as resolved.
Show resolved
Hide resolved
|
||
python -m pip install pybtex | ||
BradyPlanden marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Run unit tests | ||
if: ${{ ! cancelled() }} | ||
BradyPlanden marked this conversation as resolved.
Show resolved
Hide resolved
BradyPlanden marked this conversation as resolved.
Show resolved
Hide resolved
|
||
run: | | ||
python -m pytest --unit | ||
BradyPlanden marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- name: Run integration tests | ||
if: ${{ ! cancelled() }} | ||
run: | | ||
python -m pytest --integration | ||
|
||
BradyPlanden marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Run examples tests | ||
if: ${{ ! cancelled() }} | ||
run: | | ||
python -m pytest --nbmake --examples | ||
BradyPlanden marked this conversation as resolved.
Show resolved
Hide resolved
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: PyBOP | ||
name: Pull Request | ||
|
||
on: | ||
workflow_dispatch: | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A daily schedule should be alright for now, but when we implement the nightlies on the PyBaMM side, I will suggest matching that (which will most likely be weekly) to run a few hours after PyBaMM's wheels will have been uploaded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will most likely be weekly or fortnightly, and I will further recommend adding a job that needs this job and creates an issue for you. Here's how
xarray
started doing it, which is a bit complicated: pydata/xarray#4583 but it seems to work well: pydata/xarray#8844We can use a similar workflow based on this, or implement a simpler job that doesn't need to parse the logs and so on. and use existing third-party GitHub Actions that can do the same task (opening an issue, adding the workflow URL in the contents, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since I saw the cross-link: we've since moved on to using xarray-contrib/issue-from-pytest-log, which abstracts away a lot of the complex code and in general is a lot more robust.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks wonderful – thanks a lot, @keewis!