Rolling #25
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: Rolling | |
| on: | |
| schedule: | |
| - cron: 0 8 * * 1 # Weekly, Monday 8am UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| issues: write | |
| jobs: | |
| test: | |
| name: test (${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }}-latest | |
| env: | |
| USE_BAZEL_VERSION: rolling | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu, macos] | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: bazel-contrib/setup-bazel@0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| disk-cache: ${{ github.workflow }} | |
| repository-cache: true | |
| - run: bazel test //... | |
| examples: | |
| runs-on: ubuntu-latest | |
| env: | |
| USE_BAZEL_VERSION: rolling | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: bazel-contrib/setup-bazel@0.19.0 | |
| with: | |
| bazelisk-cache: true | |
| disk-cache: ${{ github.workflow }}-examples | |
| repository-cache: true | |
| - run: examples/integration_test.sh | |
| create-issue-on-failure: | |
| runs-on: ubuntu-latest | |
| needs: [test, examples] | |
| if: failure() | |
| steps: | |
| - name: Check for existing issue | |
| id: check | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const issues = await github.rest.issues.listForRepo({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| labels: 'rolling-bazel', | |
| state: 'open' | |
| }); | |
| return issues.data.length > 0; | |
| result-encoding: string | |
| - name: Create issue | |
| if: steps.check.outputs.result == 'false' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: |- | |
| await github.rest.issues.create({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| title: 'Rolling Bazel CI failure', | |
| labels: ['rolling-bazel'], | |
| body: `The weekly rolling Bazel CI test has failed. | |
| **Run:** ${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId} | |
| This issue will not be recreated while it remains open. Close it once the issue is resolved.` | |
| }); |