-
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
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,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