-
Notifications
You must be signed in to change notification settings - Fork 706
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create proxy workflow to act as label/ci/cd trigger entry point
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
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: Test | ||
run : | | ||
echo "Hello World!" | ||
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 \ | ||
-d '{"ref":"${{ github.head_ref }}","inputs":{"event_name":"${{ github.event_name }}", "event_number" : "${{ github.event.number }}", "test":"${{ github.event.label.name }}", "ref":"${{ github.ref }}"}}' | ||