1name: "Cron triggers for CI"
2on:
3  schedule:
4    # “At 02:34 on Monday.”
5    #
6    # https://crontab.guru/#34_2_*_*_1
7    #
8    # This is used to perform a weekly run of CI for all release branches,
9    # ideally in off-work-hours to not clog up the queue.
10    - cron: '34 2 * * 1'
11
12    # "At 02:34 on Sunday and every day-of-week from Tuesday through Saturday"
13    #
14    # https://crontab.guru/#34_2_*_*_0,2-6
15    #
16    # This is used to perform a daily run of CI for the `main` branch to prime
17    # caches for github actions and the merge queue. Note that this frequency
18    # doesn't overlap the above schedule to avoid triggering two builds on the
19    # same day.
20    - cron: '34 2 * * 0,2-6'
21
22  # Allow manually triggering this request via a button
23  workflow_dispatch:
24
25permissions:
26  issues: write
27  actions: write
28
29jobs:
30  run:
31    if: "github.repository == 'bytecodealliance/wasmtime' || !github.event.schedule"
32    name: Trigger release branch CI
33    runs-on: ubuntu-latest
34    steps:
35      - uses: actions/checkout@v6
36        with:
37          submodules: true
38          fetch-depth: 0
39
40      # Always trigger a CI run on the `main` branch to prime GHA caches.
41      - run: gh workflow run main.yml --ref main
42        name: Trigger main branch CI daily
43        env:
44          GH_TOKEN: ${{ github.token }}
45
46      # If this is a once-a-week run then additionally trigger CI for release
47      # branches to ensure that the CI there is kept up-to-date.
48      - run: rustc ci/trigger-release-branch-ci.rs
49      - run: ./trigger-release-branch-ci
50        name: Trigger release branch CI weekly
51        env:
52          GH_TOKEN: ${{ github.token }}
53        if: "github.event.schedule == '34 2 * * 1' || !github.event.schedule"
54