Queue Develop Branch (pull_request) #4
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: Regression Suite Entry Point CI/CD | |
run-name : Queue ${{ github.event_name == 'push' && 'CI' || github.event.label.name }} (${{ github.event_name }}) | |
on: | |
push: | |
branches: [ master, develop ] | |
# See https://stackoverflow.com/a/78444521 and | |
# https://github.com/orgs/community/discussions/26874#discussioncomment-3253755 | |
# as well as official (but buried) documentation : | |
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#pull-request-events-for-forked-repositories-2 | |
pull_request: | |
types: [ labeled ] | |
# Write our tests out this way for easier legibility | |
# testsSet : | |
# - key : value | |
# key : value | |
# tests : | |
# - value | |
# - value | |
# - < next test > | |
# https://stackoverflow.com/a/68940067 | |
jobs: | |
queue_tests: | |
if : ${{ contains( fromJson('["compile-tests","all-tests"]'), github.event.label.name ) || github.event_name == 'push' }} | |
name: Queue Test (${{ github.event_name == 'push' && github.ref_name || github.event.label.name }}) | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
steps: | |
- name: Dispatch Regression Suite | |
run : | | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ github.token }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/workflows/ci.yml/dispatches \ | |
--data-binary @- << EOF | |
{ | |
"ref" : "${{ github.event_name == 'push' && github.ref_name || github.event.pull_request.head.repo.full_name == github.repository && github.event.pull_request.head.ref || github.event.pull_request.base.ref }}", | |
"inputs" : | |
{ | |
"event_name" : "${{ github.event_name }}", | |
"event_number" : "${{ github.event.number }}", | |
"test" : "${{ github.event.label.name }}", | |
"ref" : "${{ github.ref }}", | |
"sha" : "${{ github.event_name == 'push' && github.sha || github.event.pull_request.head.sha }}" | |
} | |
} | |
EOF | |