CI Additional #7
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 Additional | |
| on: | |
| workflow_dispatch: # allows you to trigger manually | |
| schedule: | |
| - cron: "0 0 1 */3 *" # Run every 3 months | |
| jobs: | |
| min-version-policy: | |
| name: Minimum Version Policy | |
| runs-on: "ubuntu-latest" | |
| env: | |
| COLUMNS: 120 | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: astral-sh/setup-uv@v7 | |
| with: | |
| version: "0.9.26" | |
| - run: | | |
| uvx --from xarray-minimum-dependency-policy==2.0.0 \ | |
| minimum-versions validate \ | |
| --policy=.github/ci/policy.yaml \ | |
| --manifest-path=./pixi.toml \ | |
| pixi:test-minimum | |
| linkcheck: | |
| name: pixi run docs-linkcheck | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: prefix-dev/setup-pixi@v0.9.0 | |
| - run: pixi run docs-linkcheck | |
| create-issue-on-failure: | |
| name: Create issue on failure | |
| runs-on: ubuntu-latest | |
| needs: [min-version-policy, linkcheck] | |
| if: | | |
| always() && | |
| (needs.min-version-policy.result == 'failure' || needs.linkcheck.result == 'failure') && | |
| github.event_name == 'schedule' | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Create issue | |
| uses: actions/github-script@v8 | |
| with: | |
| script: | | |
| const workflowUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; | |
| const title = `CI Additional workflow failed - ${new Date().toISOString().split('T')[0]}`; | |
| const body = `The [CI Additional workflow](${workflowUrl}) failed on its scheduled run. | |
| **Workflow Run:** ${context.runId} | |
| **Trigger:** ${context.eventName} | |
| **Branch:** ${context.ref} | |
| Please investigate the failure and fix the issues. | |
| _This issue was automatically created by the workflow._`; | |
| await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: title, | |
| body: body, | |
| labels: ['bug', 'automated'] | |
| }); |