145810e52SAlex Crichtonname: "Cron triggers for CI"
245810e52SAlex Crichtonon:
345810e52SAlex Crichton  schedule:
445810e52SAlex Crichton    # “At 02:34 on Monday.”
545810e52SAlex Crichton    #
645810e52SAlex Crichton    # https://crontab.guru/#34_2_*_*_1
745810e52SAlex Crichton    #
845810e52SAlex Crichton    # This is used to perform a weekly run of CI for all release branches,
945810e52SAlex Crichton    # ideally in off-work-hours to not clog up the queue.
1045810e52SAlex Crichton    - cron: '34 2 * * 1'
1145810e52SAlex Crichton
1245810e52SAlex Crichton    # "At 02:34 on Sunday and every day-of-week from Tuesday through Saturday"
1345810e52SAlex Crichton    #
1445810e52SAlex Crichton    # https://crontab.guru/#34_2_*_*_0,2-6
1545810e52SAlex Crichton    #
1645810e52SAlex Crichton    # This is used to perform a daily run of CI for the `main` branch to prime
1745810e52SAlex Crichton    # caches for github actions and the merge queue. Note that this frequency
1845810e52SAlex Crichton    # doesn't overlap the above schedule to avoid triggering two builds on the
1945810e52SAlex Crichton    # same day.
2045810e52SAlex Crichton    - cron: '34 2 * * 0,2-6'
2145810e52SAlex Crichton
2245810e52SAlex Crichton  # Allow manually triggering this request via a button
2345810e52SAlex Crichton  workflow_dispatch:
2445810e52SAlex Crichton
2545810e52SAlex Crichtonpermissions:
2645810e52SAlex Crichton  issues: write
2745810e52SAlex Crichton  actions: write
2845810e52SAlex Crichton
2945810e52SAlex Crichtonjobs:
3045810e52SAlex Crichton  run:
3145810e52SAlex Crichton    if: "github.repository == 'bytecodealliance/wasmtime' || !github.event.schedule"
3245810e52SAlex Crichton    name: Trigger release branch CI
3345810e52SAlex Crichton    runs-on: ubuntu-latest
3445810e52SAlex Crichton    steps:
35*7cca98e5SAlex Crichton      - uses: actions/checkout@v6
3645810e52SAlex Crichton        with:
3745810e52SAlex Crichton          submodules: true
3845810e52SAlex Crichton          fetch-depth: 0
3945810e52SAlex Crichton
4045810e52SAlex Crichton      # Always trigger a CI run on the `main` branch to prime GHA caches.
4145810e52SAlex Crichton      - run: gh workflow run main.yml --ref main
4245810e52SAlex Crichton        name: Trigger main branch CI daily
4345810e52SAlex Crichton        env:
4445810e52SAlex Crichton          GH_TOKEN: ${{ github.token }}
4545810e52SAlex Crichton
4645810e52SAlex Crichton      # If this is a once-a-week run then additionally trigger CI for release
4745810e52SAlex Crichton      # branches to ensure that the CI there is kept up-to-date.
4845810e52SAlex Crichton      - run: rustc ci/trigger-release-branch-ci.rs
4945810e52SAlex Crichton      - run: ./trigger-release-branch-ci
5045810e52SAlex Crichton        name: Trigger release branch CI weekly
5145810e52SAlex Crichton        env:
5245810e52SAlex Crichton          GH_TOKEN: ${{ github.token }}
53eab0a9deSAlex Crichton        if: "github.event.schedule == '34 2 * * 1' || !github.event.schedule"
54