Nightly CI #2550
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
| # adapted from xarray's nightly CI | |
| name: Nightly CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 0 * * *" # Daily "At 00:00" UTC | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| detect-test-upstream-trigger: | |
| name: "Detect CI Trigger: [test-upstream]" | |
| if: | | |
| github.repository_owner == 'xarray-contrib' | |
| && (github.event_name == 'push' || github.event_name == 'pull_request') | |
| runs-on: ubuntu-latest | |
| outputs: | |
| triggered: ${{ steps.detect-trigger.outputs.trigger-found }} | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 2 | |
| - uses: xarray-contrib/ci-trigger@v1.2 | |
| id: detect-trigger | |
| with: | |
| keyword: "[test-upstream]" | |
| upstream-dev: | |
| name: upstream-dev | |
| runs-on: ubuntu-latest | |
| needs: detect-test-upstream-trigger | |
| if: | | |
| always() | |
| && github.repository_owner == 'xarray-contrib' | |
| && ( | |
| (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch') | |
| || needs.detect-test-upstream-trigger.outputs.triggered == 'true' | |
| || ( | |
| github.event_name == 'pull_request' | |
| && contains(github.event.pull_request.labels.*.name, 'run-upstream') | |
| ) | |
| ) | |
| outputs: | |
| artifacts_availability: ${{ steps.status.outputs.ARTIFACTS_AVAILABLE }} | |
| env: | |
| FORCE_COLOR: 3 | |
| steps: | |
| - name: checkout the repository | |
| uses: actions/checkout@v5 | |
| with: | |
| # need to fetch all tags to get a correct version | |
| fetch-depth: 0 # fetch all branches and tags | |
| - name: remove lockfile | |
| run: | | |
| rm pixi.lock | |
| - name: setup environment | |
| uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # 0.9.3 | |
| with: | |
| environments: "nightly" | |
| locked: false | |
| frozen: false | |
| cache: false | |
| - name: import pint-xarray | |
| run: | | |
| pixi run -e nightly python -c 'import pint_xarray' | |
| - name: run tests | |
| if: success() | |
| id: status | |
| run: | | |
| pixi run -e nightly tests -rf --report-log=pytest-log.jsonl | |
| - name: report failures | |
| if: | | |
| failure() | |
| && steps.tests.outcome == 'failure' | |
| && github.event_name == 'schedule' | |
| uses: xarray-contrib/issue-from-pytest-log@v1 | |
| with: | |
| log-path: pytest-log.jsonl |