upstream-dev CI #415
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: upstream-dev CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| schedule: | |
| - cron: "0 18 * * 0" # Weekly "On Sundays at 18:00" UTC | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| jobs: | |
| detect-test-upstream-trigger: | |
| name: "Detect CI Trigger: [test-upstream]" | |
| if: 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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| fetch-depth: 2 | |
| persist-credentials: false | |
| - uses: xarray-contrib/ci-trigger@10cd2bfec3484946a4058a421ddf9cfad101e715 # v1.2.1 | |
| 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 == 'umr-lops/xarray-ceos-alos2' | |
| && ( | |
| github.event_name == 'schedule' | |
| || github.event_name == 'workflow_dispatch' | |
| || needs.detect-test-upstream-trigger.outputs.triggered == 'true' | |
| || contains(github.event.pull_request.labels.*.name, 'run-upstream') | |
| ) | |
| defaults: | |
| run: | |
| shell: bash -l {0} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| env: ["test-nightly"] | |
| env: | |
| PIXI_ENV: ${{ matrix.env }} | |
| steps: | |
| - name: checkout the repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| # need to fetch all tags to get a correct version | |
| fetch-depth: 0 # fetch all branches and tags | |
| persist-credentials: false | |
| - name: Setup pixi | |
| uses: prefix-dev/setup-pixi@a09b6247153796b190642a2b53fac4241043cf6f # v0.10.0 | |
| with: | |
| cache: false | |
| environments: ${{ matrix.env }} | |
| cache-write: ${{ github.event_name == 'push' && github.ref_name == 'main' }} | |
| manifest-path: ci/nightly | |
| - name: Run tests | |
| run: | | |
| pixi run \ | |
| --manifest-path ci/nightly \ | |
| -e "$PIXI_ENV" \ | |
| --frozen \ | |
| -- \ | |
| python -m pytest --cov=ceos_alos2 -rf --report-log=pytest-log.jsonl | |
| - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| if: failure() | |
| with: | |
| name: log file | |
| path: pytest-log.jsonl | |
| create-issue: | |
| name: report failing upstream-dev runs | |
| needs: upstream-dev | |
| runs-on: ubuntu-latest | |
| if: | | |
| always() | |
| && needs.upstream-dev.result == 'failure' | |
| && github.event_name == 'schedule' | |
| permissions: | |
| issues: write # open or edit an issue for failed CI runs | |
| steps: | |
| - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 | |
| with: | |
| name: log file | |
| - name: report failures | |
| uses: scientific-python/issue-from-pytest-log-action@054799b34bd75a5fd6c86277a4a8a575224e60c6 # v1.6.1 | |
| with: | |
| log-path: pytest-log.jsonl |