Test Upstream Dependencies #481
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: Test Upstream Dependencies | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- HISTORY.rst | |
- README.rst | |
- pyproject.toml | |
- setup.cfg | |
- clisops/__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: test-upstream-dev (Python${{ matrix.python-version }}) | |
runs-on: ubuntu-latest | |
if: | | |
(github.event_name == 'schedule') || | |
(github.event_name == 'workflow_dispatch') || | |
(github.event_name == 'push') | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: | |
- "3.12" | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@4d991eb9b905ef189e4c376166672c3f2f230481 # v2.11.0 | |
with: | |
disable-sudo: true | |
egress-policy: audit | |
- name: Checkout Repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags. | |
persist-credentials: false | |
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }} | |
uses: mamba-org/setup-micromamba@0dea6379afdaffa5d528b3d1dabc45da37f443fc # v2.0.4 | |
with: | |
cache-downloads: true | |
cache-environment: true | |
environment-file: environment.yml | |
create-args: >- | |
python=${{ matrix.python-version }} | |
pytest-reportlog | |
- name: Install CLISOPS | |
run: | | |
python -m pip install --no-deps --no-user --editable . | |
- name: Install upstream versions | |
run: | | |
python -m pip install -r CI/requirements_upstream.txt | |
- 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=clisops --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 == 'roocs' | |
uses: xarray-contrib/issue-from-pytest-log@v1 | |
with: | |
log-path: output-${{ matrix.python-version }}-log.jsonl |