this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/ci: support running e2e tests on pushes to ci/test

Currently, the e2e tests only run in CI on commits to master. The
alternative is to setup a local environment with secrets etc. This is
expensive, painful, and a security risk.

Instead allow trusted people to push to ci/test and have that branch
also be a valid condition for triggering the e2e tests. We continue to
do this only in the main repository, because the secrets are not
available elsewhere (intentionally so).

There is no increased risk of relaxing this condition to allow
triggering these tests from ci/test, because pushing to that branch is
already an action that is privileged.

Signed-off-by: Roger Peppe <rogpeppe@gmail.com>
Change-Id: I035ed4f8d398f8dfe70a5f3db988697f9aaaadc1
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1193330
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Unity-Result: CUE porcuepine <cue.porcuepine@gmail.com>

+7 -7
+6 -6
.github/workflows/trybot.yml
··· 167 167 - name: gcloud auth for end-to-end tests 168 168 id: auth 169 169 if: |- 170 - github.repository == 'cue-lang/cue' && ((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' 171 - Dispatch-Trailer: {"type":"')))) && (matrix.go-version == '1.22.x' && matrix.runner == 'ubuntu-22.04') 170 + github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' 171 + Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.22.x' && matrix.runner == 'ubuntu-22.04') 172 172 uses: google-github-actions/auth@v2 173 173 with: 174 174 credentials_json: ${{ secrets.E2E_GCLOUD_KEY }} 175 175 - if: |- 176 - github.repository == 'cue-lang/cue' && ((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' 177 - Dispatch-Trailer: {"type":"')))) && (matrix.go-version == '1.22.x' && matrix.runner == 'ubuntu-22.04') 176 + github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' 177 + Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.22.x' && matrix.runner == 'ubuntu-22.04') 178 178 name: gcloud setup for end-to-end tests 179 179 uses: google-github-actions/setup-gcloud@v2 180 180 - if: |- 181 - github.repository == 'cue-lang/cue' && ((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' 182 - Dispatch-Trailer: {"type":"')))) && (matrix.go-version == '1.22.x' && matrix.runner == 'ubuntu-22.04') 181 + github.repository == 'cue-lang/cue' && (((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' 182 + Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.22.x' && matrix.runner == 'ubuntu-22.04') 183 183 name: End-to-end test 184 184 env: 185 185 CUE_TEST_LOGINS: ${{ secrets.E2E_CUE_LOGINS }}
+1 -1
internal/ci/github/trybot.cue
··· 116 116 // The end-to-end tests require a github token secret and are a bit slow, 117 117 // so we only run them on pushes to protected branches and on one 118 118 // environment in the source repo. 119 - if: "github.repository == '\(_repo.githubRepositoryPath)' && \(_repo.isProtectedBranch) && \(_isLatestLinux)" 119 + if: "github.repository == '\(_repo.githubRepositoryPath)' && (\(_repo.isProtectedBranch) || \(_repo.isTestDefaultBranch)) && \(_isLatestLinux)" 120 120 }] & [ 121 121 // Two setup steps per the upstream docs: 122 122 // https://github.com/google-github-actions/setup-gcloud#service-account-key-json