From 23ff1cbfb765af3ad14cd4c2e958edb260b9ac0e Mon Sep 17 00:00:00 2001 From: Paul Jolly Date: Thu, 5 Sep 2024 09:58:58 +0100 Subject: [PATCH] [release-branch.v0.10] internal/ci: switch to '.yaml' workflow file extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This alignment with the filetype 'yaml' makese logic elsewhere simpler. Specifically the `@export`-like behaviour of writefs in https://cuelang.org/cl/1200710. Also update the base earlyChecks declaration to default to a pseudo-version of the main CUE repo. This allows an override in this repo to use the "current" earlyChecks package. This allows the base package to be "copied" (for now) to other repos without further changes/overrides. Signed-off-by: Paul Jolly Change-Id: If0a3c1c1d392782c25b3f15f0d75ff32cbc6933c Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1200723 TryBot-Result: CUEcueckoo Unity-Result: CUE porcuepine Reviewed-by: Daniel Martí Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1203066 --- .github/workflows/{evict_caches.yml => evict_caches.yaml} | 4 ++-- .../{push_tip_to_trybot.yml => push_tip_to_trybot.yaml} | 0 .github/workflows/{release.yml => release.yaml} | 0 .github/workflows/{tip_triggers.yml => tip_triggers.yaml} | 0 .github/workflows/{trybot.yml => trybot.yaml} | 0 .../workflows/{trybot_dispatch.yml => trybot_dispatch.yaml} | 0 internal/ci/base/base.cue | 2 +- internal/ci/base/github.cue | 2 +- internal/ci/repo/repo.cue | 2 ++ 9 files changed, 6 insertions(+), 4 deletions(-) rename .github/workflows/{evict_caches.yml => evict_caches.yaml} (98%) rename .github/workflows/{push_tip_to_trybot.yml => push_tip_to_trybot.yaml} (100%) rename .github/workflows/{release.yml => release.yaml} (100%) rename .github/workflows/{tip_triggers.yml => tip_triggers.yaml} (100%) rename .github/workflows/{trybot.yml => trybot.yaml} (100%) rename .github/workflows/{trybot_dispatch.yml => trybot_dispatch.yaml} (100%) diff --git a/.github/workflows/evict_caches.yml b/.github/workflows/evict_caches.yaml similarity index 98% rename from .github/workflows/evict_caches.yml rename to .github/workflows/evict_caches.yaml index ce41960a742..cfc0f531c38 100644 --- a/.github/workflows/evict_caches.yml +++ b/.github/workflows/evict_caches.yaml @@ -89,7 +89,7 @@ jobs: echo Latest commit: $sha echo "Trigger workflow on cue-lang/cue" - 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-with-body -X POST https://api.github.com/repos/cue-lang/cue/actions/workflows/trybot.yml/dispatches -d "{\"ref\":\"$j\"}" + 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-with-body -X POST https://api.github.com/repos/cue-lang/cue/actions/workflows/trybot.yaml/dispatches -d "{\"ref\":\"$j\"}" # Ensure that the trybot repo has the latest commit for # this branch. If the force-push results in a commit @@ -121,7 +121,7 @@ jobs: # We are up-to-date, i.e. the push did nothing, hence we need to trigger a workflow_dispatch # in the trybot repo. echo "Trigger workflow on cue-lang/cue-trybot" - 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-with-body -X POST https://api.github.com/repos/cue-lang/cue-trybot/actions/workflows/trybot.yml/dispatches -d "{\"ref\":\"$j\"}" + 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-with-body -X POST https://api.github.com/repos/cue-lang/cue-trybot/actions/workflows/trybot.yaml/dispatches -d "{\"ref\":\"$j\"}" else echo "Force-push to cue-lang/cue-trybot did work; nothing to do" fi diff --git a/.github/workflows/push_tip_to_trybot.yml b/.github/workflows/push_tip_to_trybot.yaml similarity index 100% rename from .github/workflows/push_tip_to_trybot.yml rename to .github/workflows/push_tip_to_trybot.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yaml similarity index 100% rename from .github/workflows/release.yml rename to .github/workflows/release.yaml diff --git a/.github/workflows/tip_triggers.yml b/.github/workflows/tip_triggers.yaml similarity index 100% rename from .github/workflows/tip_triggers.yml rename to .github/workflows/tip_triggers.yaml diff --git a/.github/workflows/trybot.yml b/.github/workflows/trybot.yaml similarity index 100% rename from .github/workflows/trybot.yml rename to .github/workflows/trybot.yaml diff --git a/.github/workflows/trybot_dispatch.yml b/.github/workflows/trybot_dispatch.yaml similarity index 100% rename from .github/workflows/trybot_dispatch.yml rename to .github/workflows/trybot_dispatch.yaml diff --git a/internal/ci/base/base.cue b/internal/ci/base/base.cue index 39b9010e21a..4f55c9b2a54 100644 --- a/internal/ci/base/base.cue +++ b/internal/ci/base/base.cue @@ -55,7 +55,7 @@ botGerritHubUser: *botGitHubUser | string botGerritHubUserPasswordSecretsKey: *(strings.ToUpper(botGitHubUser) + "_GERRITHUB_PASSWORD") | string botGerritHubUserEmail: *botGitHubUserEmail | string -workflowFileExtension: ".yml" +workflowFileExtension: ".yaml" linuxMachine: string diff --git a/internal/ci/base/github.cue b/internal/ci/base/github.cue index d9f081a2ad9..d724d3680b0 100644 --- a/internal/ci/base/github.cue +++ b/internal/ci/base/github.cue @@ -100,7 +100,7 @@ checkoutCode: { earlyChecks: json.#step & { name: "Early git and code sanity checks" - run: "go run ./internal/ci/checks" + run: "go run ./internal/ci/checks" } curlGitHubAPI: { diff --git a/internal/ci/repo/repo.cue b/internal/ci/repo/repo.cue index d35eb2dbdcf..6a9b329ae25 100644 --- a/internal/ci/repo/repo.cue +++ b/internal/ci/repo/repo.cue @@ -9,6 +9,8 @@ import ( base +earlyChecks: run: "go run ./internal/ci/checks" + githubRepositoryPath: "cue-lang/cue" unityRepositoryPath: "cue-unity/unity-private"