diff --git a/.github/workflows/push_tip_to_trybot.yaml b/.github/workflows/push_tip_to_trybot.yaml index 6416b7008..9fa0056ad 100644 --- a/.github/workflows/push_tip_to_trybot.yaml +++ b/.github/workflows/push_tip_to_trybot.yaml @@ -1,12 +1,18 @@ # Code generated internal/ci/base/write.cue; DO NOT EDIT. +name: Push tip to trybot +"on": + push: + branches: + - master + - release-branch.* concurrency: push_tip_to_trybot jobs: push: defaults: run: shell: bash --noprofile --norc -euo pipefail {0} - runs-on: ns-linux-amd64-small + runs-on: ns-linux-amd64-small;overrides.cache-tag=cue-dispatch-workflow if: ${{github.repository == 'cue-lang/cue'}} steps: - name: Write netrc file for cueckoo Gerrithub @@ -43,9 +49,3 @@ jobs: echo "Giving up" exit 1 fi -name: Push tip to trybot -"on": - push: - branches: - - master - - release-branch.* diff --git a/.github/workflows/tip_triggers.yaml b/.github/workflows/tip_triggers.yaml index 85422058c..10e084051 100644 --- a/.github/workflows/tip_triggers.yaml +++ b/.github/workflows/tip_triggers.yaml @@ -11,7 +11,7 @@ jobs: defaults: run: shell: bash --noprofile --norc -euo pipefail {0} - runs-on: ns-linux-amd64-small + runs-on: ns-linux-amd64-small;overrides.cache-tag=cue-dispatch-workflow if: ${{github.repository == 'cue-lang/cue'}} steps: - name: Trigger unity build diff --git a/.github/workflows/trybot_dispatch.yaml b/.github/workflows/trybot_dispatch.yaml index 97146f51b..f7c0c2c39 100644 --- a/.github/workflows/trybot_dispatch.yaml +++ b/.github/workflows/trybot_dispatch.yaml @@ -11,7 +11,7 @@ jobs: defaults: run: shell: bash --noprofile --norc -euo pipefail {0} - runs-on: ns-linux-amd64-small + runs-on: ns-linux-amd64-small;overrides.cache-tag=cue-dispatch-workflow if: ${{ ((github.ref == 'refs/heads/ci/test') && false) || github.event.client_payload.type == 'trybot' }} steps: - name: Write netrc file for cueckoo Gerrithub diff --git a/internal/ci/base/base.cue b/internal/ci/base/base.cue index 662308191..1cb9e02b8 100644 --- a/internal/ci/base/base.cue +++ b/internal/ci/base/base.cue @@ -88,6 +88,13 @@ linuxMachine: string | *linuxSmallMachine macosMachine: string | *"ns-macos-arm64" windowsMachine: string | *"ns-windows-amd64" +// Append this suffix to "runs-on" to prevent workflows from sharing the default caches +// for the repository and runner profile. For example, this is useful so that +// a "tip_triggers" workflow on the cue repo to push to rebuild tip.cuelang.org +// does not share cache volumes with the main "trybot" workflow, which makes much heavier +// use of the cache. Mixing the two would lead to less effective cache updates. +overrideCacheTagDispatch: ";overrides.cache-tag=cue-dispatch-workflow" + // Use the latest Go version for extra checks, // such as running tests with the data race detector. latestGo: "1.24.x" diff --git a/internal/ci/base/gerrithub.cue b/internal/ci/base/gerrithub.cue index 6cfa80bb2..2c8a32117 100644 --- a/internal/ci/base/gerrithub.cue +++ b/internal/ci/base/gerrithub.cue @@ -48,7 +48,7 @@ trybotDispatchWorkflow: bashWorkflow & { } jobs: { (trybot.key): { - "runs-on": linuxSmallMachine + "runs-on": linuxSmallMachine + overrideCacheTagDispatch let goodDummyData = [if json.Marshal(#dummyDispatch) != _|_ {true}, false][0] @@ -165,16 +165,12 @@ pushTipToTrybotWorkflow: bashWorkflow & { on: { push: branches: protectedBranchPatterns } - jobs: push: { - "runs-on": linuxSmallMachine - if: "${{github.repository == '\(githubRepositoryPath)'}}" - } - name: "Push tip to \(trybot.key)" - concurrency: "push_tip_to_trybot" jobs: push: { + "runs-on": linuxSmallMachine + overrideCacheTagDispatch + if: "${{github.repository == '\(githubRepositoryPath)'}}" steps: [ writeNetrcFile, { diff --git a/internal/ci/github/tip_triggers.cue b/internal/ci/github/tip_triggers.cue index 0e4396ae5..b6c44224d 100644 --- a/internal/ci/github/tip_triggers.cue +++ b/internal/ci/github/tip_triggers.cue @@ -21,7 +21,7 @@ workflows: tip_triggers: _repo.bashWorkflow & { name: "Triggers on push to tip" on: push: branches: [_repo.defaultBranch, _repo.testDefaultBranch] jobs: push: { - "runs-on": _repo.linuxSmallMachine + "runs-on": _repo.linuxSmallMachine + _repo.overrideCacheTagDispatch if: "${{github.repository == '\(_repo.githubRepositoryPath)'}}" steps: [ _repo.repositoryDispatch & {