Skip to content

CI Upstream

CI Upstream #470

name: CI Upstream
on:
push:
branches:
- main
pull_request:
branches:
- main
types: [opened, reopened, synchronize, labeled]
schedule:
- cron: "0 0 * * *" # Daily “At 00:00” UTC
# TODO: switch to weekly once I know this works
# - cron: "0 17 * * 1" # “At 17:00 on Monday” UTC
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
upstream-dev:
name: upstream-dev
runs-on: ubuntu-latest
if: |
always()
&& (
github.event_name == 'schedule'
|| contains( github.event.pull_request.labels.*.name, 'run-upstream')
)
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: false
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.
- name: Set up conda environment
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/requirements/environment.yml
environment-name: regionmask-tests
create-args: >-
python=${{ matrix.python-version }}
pytest-reportlog
conda
- name: Install upstream versions
run: |
bash ci/install-upstream-wheels.sh
- name: Install regionmask
run: |
python -m pip install --no-deps -e .
- name: Version info
run: |
conda info -a
conda list
- name: Import regionmask
run: |
python -c 'import regionmask'
- name: Run Tests
if: success()
id: status
run: |
python -m pytest --timeout=60 -rf \
--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 == 'regionmask'
uses: xarray-contrib/issue-from-pytest-log@v1
with:
log-path: output-${{ matrix.python-version }}-log.jsonl