-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### What kind of change does this PR introduce? * Adds a dedicated upstream build test workflow that runs nightly to test for incompatibilities with upstream development dependencies * Added a new requirements-upstream.txt file for installing development branch dependencies ### Does this PR introduce a breaking change? No. ### Other information: This approach was directly adapted from xclim.
- Loading branch information
Showing
6 changed files
with
104 additions
and
24 deletions.
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 |
---|---|---|
|
@@ -70,7 +70,7 @@ jobs: | |
git config --local user.name "bumpversion[bot]" | ||
- name: Install bump-my-version | ||
run: | | ||
python -m pip install "bump-my-version>=0.17.1" | ||
python -m pip install "bump-my-version>=0.18.3" | ||
- name: Current Version | ||
run: | | ||
bump-my-version show current_version | ||
|
@@ -80,11 +80,12 @@ jobs: | |
run: | | ||
if [[ ${{ env.CURRENT_VERSION }} =~ -dev(\.\d+)? ]]; then | ||
echo "Development version (ends in 'dev(\.\d+)?'), bumping 'build' version" | ||
bump-my-version show new_version --increment build | ||
bump-my-version bump build | ||
else | ||
echo "Version is stable, bumping 'patch' version" | ||
bump-my-version show new_version --increment patch | ||
bump-my-version bump patch | ||
fi | ||
bump-my-version show-bump | ||
- name: Push Changes | ||
uses: ad-m/[email protected] | ||
with: | ||
|
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 |
---|---|---|
|
@@ -67,7 +67,7 @@ jobs: | |
- python-version: "3.10" | ||
tox-build: "py310-coveralls" | ||
- python-version: "3.11" | ||
tox-build: "py311-xclim-coveralls" | ||
tox-build: "py311-coveralls" | ||
- python-version: "3.12" | ||
tox-build: "py312-esmpy-coveralls" | ||
defaults: | ||
|
@@ -124,20 +124,16 @@ jobs: | |
# COVERALLS_SERVICE_NAME: github | ||
|
||
test-conda: | ||
name: Python${{ matrix.python-version }} (conda, upstream=${{ matrix.xclim-upstream }}) | ||
name: Python${{ matrix.python-version }} (conda) | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- python-version: "3.9" | ||
xclim-upstream: false | ||
- python-version: "3.10" | ||
xclim-upstream: false | ||
- python-version: "3.11" | ||
xclim-upstream: false | ||
- python-version: "3.12" | ||
xclim-upstream: true | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
@@ -151,26 +147,22 @@ jobs: | |
uses: mamba-org/[email protected] | ||
with: | ||
cache-downloads: true | ||
cache-environment: true | ||
environment-file: environment-dev.yml | ||
create-args: >- | ||
mamba | ||
python=${{ matrix.python-version }} | ||
- name: Downgrade intake-esm | ||
if: matrix.python-version == '3.9' | ||
run: | | ||
micromamba install -y -c conda-forge intake-esm=2023.11.10 | ||
- name: Install xclim main branch | ||
if: matrix.xclim-upstream | ||
run: | | ||
python -m pip install git+https://github.com/Ouranosinc/xclim.git@main | ||
- name: Conda and Mamba versions | ||
run: | | ||
mamba --version | ||
micromamba list | ||
echo "micromamba $(micromamba --version)" | ||
- name: Compile catalogs and install xscen | ||
run: | | ||
make translate | ||
python -m pip install --no-deps . | ||
python -m pip install --no-user --no-deps . | ||
- name: Check versions | ||
run: | | ||
conda list | ||
|
@@ -194,10 +186,6 @@ jobs: | |
runs-on: ubuntu-latest | ||
container: python:3-slim | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | ||
with: | ||
gress-policy: audit | ||
- name: Coveralls Finished | ||
run: | | ||
python -m pip install --upgrade coveralls | ||
|
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,88 @@ | ||
name: Test Upstream Dependencies | ||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- .cruft.json | ||
- CHANGES.rst | ||
- README.rst | ||
- pyproject.toml | ||
- setup.cfg | ||
- setup.py | ||
- xscen/__init__.py | ||
schedule: | ||
- cron: "0 0 * * *" # Daily “At 00:00” UTC | ||
workflow_dispatch: # allows you to trigger the workflow run manually | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
upstream-dev: | ||
name: Python${{ matrix.python-version }}-upstream | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
issues: write | ||
if: | | ||
(github.event_name == 'schedule') || | ||
(github.event_name == 'workflow_dispatch') || | ||
(github.event_name == 'push') | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.10" | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0 | ||
with: | ||
audit: true | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches and tags. | ||
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }} | ||
uses: mamba-org/setup-micromamba@422500192359a097648154e8db4e39bdb6c6eed7 # v1.8.1 | ||
with: | ||
cache-downloads: true | ||
cache-environment: true | ||
environment-file: environment-dev.yml | ||
create-args: >- | ||
python=${{ matrix.python-version }} | ||
pytest-reportlog | ||
- name: Conda and Mamba versions | ||
run: | | ||
echo "micromamba: $(micromamba --version)" | ||
- name: Install upstream dependencies | ||
run: | | ||
python -m pip install -r requirements_upstream.txt | ||
- name: Install xscen | ||
run: | | ||
make translate | ||
python -m pip install --no-user --no-deps . | ||
- name: Check versions | ||
run: | | ||
micromamba list | ||
python -m pip check || true | ||
- name: Run Tests | ||
if: success() | ||
id: status | ||
run: | | ||
python -m pytest --durations=10 --cov=xscen --cov-report=term-missing --report-log output-${{ matrix.python-version }}-log.jsonl | ||
- name: Generate and publish the report | ||
if: | | ||
failure() | ||
&& steps.status.outcome == 'failure' | ||
&& github.event_name == 'schedule' | ||
&& github.repository_owner == 'Ouranosinc' | ||
uses: xarray-contrib/issue-from-pytest-log@138db94bfe4b12ac11fc1aff307ee0835feab403 # v1.2.8 | ||
with: | ||
log-path: output-${{ matrix.python-version }}-log.jsonl |
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
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 @@ | ||
xclim @ git+https://github.com/Ouranosinc/xclim.git@main |
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