-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving towards weaning off the workflow templates into a unified CI workflow file. We're refactoring the way sheduled jobs start so they work like nightly builds and can be restarted if they fail.
- Loading branch information
Showing
8 changed files
with
93 additions
and
101 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Run Scheduled Builds | ||
|
||
on: | ||
workflow_dispatch: {} | ||
schedule: | ||
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onschedule | ||
- cron: '0 */8 * * *' # Run every 8 hours | ||
|
||
permissions: | ||
contents: read # for dorny/paths-filter to fetch a list of changed files | ||
pull-requests: read # for dorny/paths-filter to read pull requests | ||
actions: write # to trigger branch nightly builds | ||
|
||
jobs: | ||
|
||
workflow-requirements: | ||
name: Check Workflow Requirements | ||
runs-on: ubuntu-22.04 | ||
outputs: | ||
requirements-met: ${{ steps.check-requirements.outputs.requirements-met }} | ||
steps: | ||
- name: Check Requirements | ||
id: check-requirements | ||
run: | | ||
if [ "${{ vars.RUN_SCHEDULED_BUILDS }}" = "1" ]; then | ||
MSG="Running workflow because RUN_SCHEDULED_BUILDS=1" | ||
echo "${MSG}" | ||
echo "${MSG}" >> "${GITHUB_STEP_SUMMARY}" | ||
echo "requirements-met=true" >> "${GITHUB_OUTPUT}" | ||
elif [ "${{ github.event.repository.fork }}" = "true" ]; then | ||
MSG="Not running workflow because ${{ github.repository }} is a fork" | ||
echo "${MSG}" | ||
echo "${MSG}" >> "${GITHUB_STEP_SUMMARY}" | ||
echo "requirements-met=false" >> "${GITHUB_OUTPUT}" | ||
elif [ "${{ github.event.repository.private }}" = "true" ]; then | ||
MSG="Not running workflow because ${{ github.repository }} is a private repository" | ||
echo "${MSG}" | ||
echo "${MSG}" >> "${GITHUB_STEP_SUMMARY}" | ||
echo "requirements-met=false" >> "${GITHUB_OUTPUT}" | ||
else | ||
MSG="Running workflow because ${{ github.repository }} is not a fork" | ||
echo "${MSG}" | ||
echo "${MSG}" >> "${GITHUB_STEP_SUMMARY}" | ||
echo "requirements-met=true" >> "${GITHUB_OUTPUT}" | ||
fi | ||
trigger-builds: | ||
name: Trigger Branch Workflows | ||
if: ${{ fromJSON(needs.workflow-requirements.outputs.requirements-met) }} | ||
runs-on: ubuntu-24.04 | ||
needs: | ||
- workflow-requirements | ||
environment: workflow-restart | ||
strategy: | ||
matrix: | ||
branch: [3006.x, 3007.x, master] | ||
steps: | ||
|
||
- name: Generate a token | ||
id: generate-token | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ vars.APP_ID }} | ||
private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
|
||
- name: Trigger ${{ matrix.branch }} branch | ||
env: | ||
GH_TOKEN: ${{ steps.generate-token.outputs.token }} | ||
run: | | ||
gh workflow run nightly.yml --repo ${{ github.repository }} --ref ${{ matrix.branch }} |
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
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
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
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
This file was deleted.
Oops, something went wrong.