Skip to content

Test Upstream Dependencies #404

Test Upstream Dependencies

Test Upstream Dependencies #404

Workflow file for this run

name: Test Upstream Dependencies
on:
push:
branches:
- main
paths-ignore:
- .cruft.json
- CHANGELOG.rst
- README.rst
- pyproject.toml
- src/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:
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@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
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.
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@617811f69075e3fd3ae68ca64220ad065877f246 # v2.0.0
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@f94477e45ef40e4403d7585ba639a9a3bcc53d43 # v1.3.0
with:
log-path: output-${{ matrix.python-version }}-log.jsonl