this repo has no description
0
fork

Configure Feed

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

internal/ci: test internal/e2e on protected branches

Only on Linux, since these end-to-end tests are slow,
and testing on different platforms or Go versions isn't useful.

Only on pushes to protected branches, since they use a github token
stored as the secret E2E_GITHUB_TOKEN, and we don't want to worry
about PR or CL trybot runs potentially leaking any secrets.
Plus, the end-to-end tests being slow means they aren't very well suited
to PR or CL trybot runs, where we want to finish relatively quickly.

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

+26
+9
.github/workflows/trybot.yml
··· 182 182 run: go test -race ./... 183 183 env: 184 184 GORACE: atexit_sleep_ms=10 185 + - if: |- 186 + ((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, ' 187 + Dispatch-Trailer: {"type":"')))) && (matrix.go-version == '1.21.x' && matrix.runner == 'ubuntu-22.04') 188 + name: End-to-end test 189 + run: |- 190 + cd internal/e2e 191 + go test 192 + env: 193 + GITHUB_TOKEN: ${{ secrets.E2E_GITHUB_TOKEN }} 185 194 - if: (matrix.go-version == '1.21.x' && matrix.runner == 'ubuntu-22.04') 186 195 name: Check 187 196 run: go vet ./...
+17
internal/ci/github/trybot.cue
··· 75 75 _goTestRace & { 76 76 if: _isLatestLinux 77 77 }, 78 + _e2eTest, 78 79 _goCheck, 79 80 _repo.checkGitClean, 80 81 ] ··· 112 113 _goTest: json.#step & { 113 114 name: "Test" 114 115 run: "go test ./..." 116 + } 117 + 118 + _e2eTest: json.#step & { 119 + name: "End-to-end test" 120 + // The end-to-end tests require a github token secret and are a bit slow, 121 + // so we only run them on pushes to protected branches and on one environment. 122 + if: "\(_repo.isProtectedBranch) && \(_isLatestLinux)" 123 + // The secret is the fine-grained access token "cue-lang/cue ci e2e for modules-testing" 124 + // owned by the porcuepine bot account with read+write access to repo administration and code 125 + // on the entire cue-labs-modules-testing org. Note that porcuepine is also an org admin, 126 + // since otherwise the repo admin access to create and delete repos does not work. 127 + env: GITHUB_TOKEN: "${{ secrets.E2E_GITHUB_TOKEN }}" 128 + run: """ 129 + cd internal/e2e 130 + go test 131 + """ 115 132 } 116 133 117 134 _goCheck: json.#step & {