nightly #609
This file contains 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: "nightly" | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
jobs: | |
spec: | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby_version: | |
- '2.7' | |
- '3.2' | |
- '3.3' | |
name: "spec (ruby ${{ matrix.ruby_version }})" | |
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_ci.yml@main" | |
secrets: "inherit" | |
with: | |
ruby_version: ${{ matrix.ruby_version }} | |
acceptance: | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby_version: | |
- '2.7' | |
- '3.2' | |
- '3.3' | |
name: "acceptance (ruby ${{ matrix.ruby_version }})" | |
needs: "spec" | |
uses: "puppetlabs/cat-github-actions/.github/workflows/gem_acceptance.yml@main" | |
secrets: "inherit" | |
with: | |
ruby_version: ${{ matrix.ruby_version }} | |
on-failure-workflow-restarter-proxy: | |
# (1) run this job after the "spec" job and... | |
needs: [spec, acceptance] | |
# (2) continue ONLY IF "spec" fails | |
if: always() && needs.spec.result == 'failure' || needs.acceptance.result == 'failure' | |
runs-on: ubuntu-latest | |
steps: | |
# (3) checkout this repository in order to "see" the following custom action | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# (4) "use" the custom action to retrigger the failed "spec job" above | |
# NOTE: pass the SOURCE_GITHUB_TOKEN to the custom action because (a) it must have | |
# this to trigger the reusable workflow that restarts the failed job; and | |
# (b) custom actions do not have access to the calling workflow's secrets | |
- name: Trigger reusable workflow | |
uses: "puppetlabs/cat-github-actions/.github/actions/workflow-restarter-proxy@main" | |
env: | |
SOURCE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
repository: ${{ github.repository }} | |
run_id: ${{ github.run_id }} |