CI Upstream #362
This file contains hidden or 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: 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 | |
| permissions: | |
| issues: write | |
| if: | | |
| github.repository == 'mpytools/mplotutils' | |
| && ( | |
| 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.13"] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| 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 | |
| --cov=mplotutils | |
| --cov-report=xml | |
| - name: Upload code coverage to Codecov | |
| uses: codecov/codecov-action@v5 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| with: | |
| flags: unittests | |
| env_vars: RUNNER_OS,PYTHON_VERSION | |
| name: codecov-umbrella | |
| fail_ci_if_error: false | |
| - name: Generate and publish the report | |
| if: | | |
| failure() | |
| && steps.status.outcome == 'failure' | |
| && github.event_name == 'schedule' | |
| && github.repository_owner == 'mpytools' | |
| uses: scientific-python/issue-from-pytest-log@v1 | |
| with: | |
| log-path: output-${{ matrix.python-version }}-log.jsonl |