Skip to content

CI Upstream

CI Upstream #38

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@v2
with:
environment-file: ci/requirements/environment.yml
environment-name: mplotutils-tests
create-args: >-
python=${{ matrix.python-version }}
pytest-reportlog
conda
- name: Install upstream versions
run: |
bash ci/install-upstream-wheels.sh
- name: Install mplotutils
run: |
python -m pip install --no-deps -e .
- name: Version info
run: |
conda info -a
conda list
- name: Import mplotutils
run: |
python -c 'import mplotutils'
- name: Run Tests
if: success()
id: status
run: |
python -m pytest -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