@@ -75,7 +75,7 @@ workflows: trybot: _repo.bashWorkflow & {
75
75
_goTestRace & {
76
76
if : _isLatestLinux
77
77
},
78
- _e2eTest ,
78
+ for v in _e2eTestSteps { v } ,
79
79
_goCheck ,
80
80
_repo .checkGitClean ,
81
81
]
@@ -115,24 +115,39 @@ workflows: trybot: _repo.bashWorkflow & {
115
115
run : " go test ./... "
116
116
}
117
117
118
- _e2eTest : json .#step & {
119
- name : " End-to-end test "
118
+ _e2eTestSteps : [... json .#step & {
120
119
// The end-to-end tests require a github token secret and are a bit slow,
121
120
// so we only run them on pushes to protected branches and on one
122
121
// environment in the source repo.
123
122
if : " github.repository == '\(_repo .githubRepositoryPath )' && \(_repo .isProtectedBranch ) && \(_isLatestLinux ) "
124
-
125
- // The secret is the fine-grained access token "cue-lang/cue ci e2e for modules-testing"
126
- // owned by the porcuepine bot account with read+write access to repo administration and code
127
- // on the entire cue-labs-modules-testing org. Note that porcuepine is also an org admin,
128
- // since otherwise the repo admin access to create and delete repos does not work.
129
- env : GITHUB_TOKEN : " ${{ secrets.E2E_GITHUB_TOKEN }} "
130
-
131
- run : """
132
- cd internal/e2e
133
- go test
134
- """
135
- }
123
+ }] & [
124
+ // Two setup steps per the upstream docs:
125
+ // https://github.com/google-github-actions/setup-gcloud#service-account-key-json
126
+ {
127
+ name : " gcloud auth for end-to-end tests "
128
+ id : " auth "
129
+ uses : " google-github-actions/auth@v1 "
130
+ // E2E_GCLOUD_KEY is a key for the service account cue-e2e-ci,
131
+ // which has the Artifact Registry Repository Administrator role.
132
+ with : credentials_json : " ${{ secrets.E2E_GCLOUD_KEY }} "
133
+ },
134
+ {
135
+ name : " gcloud setup for end-to-end tests "
136
+ uses : " google-github-actions/setup-gcloud@v1 "
137
+ },
138
+ {
139
+ name : " End-to-end test "
140
+ // The secret is the fine-grained access token "cue-lang/cue ci e2e for modules-testing"
141
+ // owned by the porcuepine bot account with read+write access to repo administration and code
142
+ // on the entire cue-labs-modules-testing org. Note that porcuepine is also an org admin,
143
+ // since otherwise the repo admin access to create and delete repos does not work.
144
+ env : GITHUB_TOKEN : " ${{ secrets.E2E_GITHUB_TOKEN }} "
145
+ run : """
146
+ cd internal/e2e
147
+ go test
148
+ """
149
+ },
150
+ ]
136
151
137
152
_goCheck : json .#step & {
138
153
// These checks can vary between platforms, as different code can be built
0 commit comments