|
49 | 49 | description: The number of test jobs to run in parallel. If not specified, defaults to 1 |
50 | 50 | default: 1 |
51 | 51 |
|
52 | | - # NOTE: to support testing different branches on different schedules, you need to specify the cron schedule in the 'determine-test-branch' step as well below |
53 | | - # Reference: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#schedule |
54 | 52 | schedule: |
55 | | - - cron: "0 22 * * 0,2,4" # The main branch cadence. This runs every Sun,Tues,Thurs |
| 53 | + - cron: "0 22 * * 1-5" # The main branch cadence. This runs every Mon-Fri |
56 | 54 | pull_request: |
57 | 55 | paths: |
58 | 56 | - ".github/workflows/forge-stable.yaml" |
@@ -147,24 +145,19 @@ jobs: |
147 | 145 | id: determine-test-branch |
148 | 146 | # NOTE: the schedule cron MUST match the one in the 'on.schedule.cron' section above |
149 | 147 | run: | |
| 148 | + BRANCH="" |
150 | 149 | if [[ "${{ github.event_name }}" == "schedule" ]]; then |
151 | | - if [[ "${{ github.event.schedule }}" == "0 22 * * 0,2,4" ]]; then |
152 | | - echo "Branch: main" |
153 | | - echo "BRANCH=main" >> $GITHUB_OUTPUT |
154 | | - else |
155 | | - echo "Unknown schedule: ${{ github.event.schedule }}" |
156 | | - exit 1 |
157 | | - fi |
| 150 | + echo "BRANCH=main" >> $GITHUB_OUTPUT |
158 | 151 | elif [[ "${{ github.event_name }}" == "push" ]]; then |
159 | | - echo "Branch: ${{ github.ref_name }}" |
160 | | - echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT |
| 152 | + echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_OUTPUT |
161 | 153 | # on workflow_dispatch, this will simply use the inputs.GIT_SHA given (or the default) |
162 | 154 | elif [[ -n "${{ inputs.GIT_SHA }}" ]]; then |
163 | 155 | echo "BRANCH=${{ inputs.GIT_SHA }}" >> $GITHUB_OUTPUT |
164 | 156 | # if GIT_SHA not provided, use the branch where workflow runs on |
165 | 157 | else |
166 | 158 | echo "BRANCH=${{ github.head_ref }}" >> $GITHUB_OUTPUT |
167 | 159 | fi |
| 160 | + echo "Branch: $(grep BRANCH= $GITHUB_OUTPUT)" |
168 | 161 | # Use the branch hash instead of the full branch name to stay under kubernetes namespace length limit |
169 | 162 | - name: Hash the branch |
170 | 163 | id: hash-branch |
|
0 commit comments