Skip to content

Commit

Permalink
internal/ci: test cuelang.org when CUE tip updates
Browse files Browse the repository at this point in the history
This triggers the cue-lang/cuelang.org trybot workflow when new commits
reach the default branch of cue-lang/cue.

This has the effect of testing the cuelang.org site build against the
(just updated) tip of cue-lang/cue, as that's one of the final things
that the cuelang.org trybot checks.

The tip_triggers workflow is used to achieve this. Its execution
conditions are modified slightly, so that its set of triggers are
invoked not only on new commits to the default branch, but also on new
commits to the default branch's designated test branch, "ci/test".
This is done to allow the new workflow dispatch to be tested ahead of CL
submission, but will also end up invoking the existing repo dispatch
trigger. This additional invocation is believed not to be problematic.

Signed-off-by: Jonathan Matthews <[email protected]>
Change-Id: I94db1710e546ce32f46bce583b7fffd7855e5dbb
Dispatch-Trailer: {"type":"trybot","CL":1201007,"patchset":1,"ref":"refs/changes/07/1201007/1","targetBranch":"master"}
  • Loading branch information
jpluscplusm authored and cueckoo committed Sep 11, 2024
1 parent 5e31683 commit 4afe39f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/tip_triggers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name: Triggers on push to tip
push:
branches:
- master
- ci/test
jobs:
push:
runs-on: ubuntu-22.04
Expand All @@ -15,3 +16,5 @@ jobs:
steps:
- name: Trigger unity build
run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail --request POST --data-binary "{\"event_type\":\"Check against ${GITHUB_SHA}\",\"client_payload\":{\"type\":\"unity\",\"payload\":{\"versions\":\"\\\"commit:${GITHUB_SHA}\\\"\"}}}" https://api.github.com/repos/cue-unity/unity-private/dispatches'
- name: Trigger tip.cuelang.org build
run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" --fail --request POST --data-binary "{\"ref\":\"master\"}" https://api.github.com/repos/cue-lang/cuelang.org/actions/workflows/trybot.yaml/dispatches'
10 changes: 8 additions & 2 deletions internal/ci/github/tip_triggers.cue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
package github

// The tip_triggers workflow. This fires for each new commit that hits the
// default branch.
// default branch or the default branch's test branch.
workflows: tip_triggers: _repo.bashWorkflow & {

name: "Triggers on push to tip"
on: push: branches: [_repo.defaultBranch]
on: push: branches: [_repo.defaultBranch, _repo.testDefaultBranch]
jobs: push: {
"runs-on": _repo.linuxMachine
if: "${{github.repository == '\(_repo.githubRepositoryPath)'}}"
Expand All @@ -40,6 +40,12 @@ workflows: tip_triggers: _repo.bashWorkflow & {
}
}
},
_repo.workflowDispatch & {
name: "Trigger tip.cuelang.org build"
#githubRepositoryPath: _repo.cuelangRepositoryPath
#botGitHubUserTokenSecretsKey: "CUECKOO_GITHUB_PAT"
#workflowID: "trybot.yaml"
},
]
}
}

0 comments on commit 4afe39f

Please sign in to comment.