@@ -2,9 +2,9 @@ name: Integration Test
22
33on :
44 push :
5- branches : [master, "feature/*"]
5+ branches : [main, master, "feature/*", "release-nextgen- *"]
66 pull_request :
7- branches : [master, "feature/*"]
7+ branches : [main, master, "feature/*", "release-nextgen- *"]
88
99jobs :
1010 integration-local :
@@ -135,8 +135,33 @@ jobs:
135135 working-directory : integration_tests/raw
136136
137137 integration-next-gen-tikv :
138- if : ${{ !contains(github.event.pull_request.labels.*.name, 'skip-integration-tests') }}
138+ if : >-
139+ ${{
140+ !contains(github.event.pull_request.labels.*.name, 'skip-integration-tests') &&
141+ (
142+ (
143+ github.event_name == 'push' &&
144+ (
145+ github.ref_name == 'main' ||
146+ github.ref_name == 'master' ||
147+ startsWith(github.ref_name, 'release-nextgen-')
148+ )
149+ ) ||
150+ (
151+ github.event_name == 'pull_request' &&
152+ github.event.pull_request.head.repo.full_name == github.repository &&
153+ (
154+ github.base_ref == 'main' ||
155+ github.base_ref == 'master' ||
156+ startsWith(github.base_ref, 'release-nextgen-')
157+ )
158+ )
159+ )
160+ }}
139161 runs-on : ubuntu-latest
162+ permissions :
163+ contents : read
164+ id-token : write
140165 steps :
141166 - name : Checkout
142167 uses : actions/checkout@v2
@@ -149,18 +174,58 @@ jobs:
149174 - name : Install gotestsum
150175 run : go install gotest.tools/gotestsum@latest
151176
152- - name : Fetch PD
177+ - name : Resolve Next-Gen Image Tags
178+ id : resolve-nextgen-tags
179+ shell : bash
180+ run : |
181+ target_branch="${GITHUB_BASE_REF:-${GITHUB_REF_NAME}}"
182+
183+ case "${target_branch}" in
184+ release-nextgen-*)
185+ pd_tag="${target_branch}"
186+ tikv_tag="${target_branch}"
187+ ;;
188+ main|master)
189+ pd_tag="master-nextgen"
190+ tikv_tag="cloud-engine-nextgen"
191+ ;;
192+ *)
193+ echo "::error::unsupported target branch: ${target_branch}"
194+ exit 1
195+ ;;
196+ esac
197+
198+ echo "pd_tag=${pd_tag}" >> "${GITHUB_OUTPUT}"
199+ echo "tikv_tag=${tikv_tag}" >> "${GITHUB_OUTPUT}"
200+
201+ - name : Authenticate to Google Cloud
202+ id : auth
203+ uses : google-github-actions/auth@v3
204+ with :
205+ project_id : pingcap-testing-account
206+ workload_identity_provider : projects/890604261603/locations/global/workloadIdentityPools/github-tikv/providers/github-oidc
207+ service_account : tidbx-gar-reader@pingcap-testing-account.iam.gserviceaccount.com
208+ token_format : access_token
209+
210+ - name : Login to GAR
211+ uses : docker/login-action@v3
212+ with :
213+ registry : us-docker.pkg.dev
214+ username : oauth2accesstoken
215+ password : ${{ steps.auth.outputs.access_token }}
216+
217+ - name : Fetch Next-Gen PD
153218 uses : shrink/actions-docker-extract@v1
154219 id : extract-pd
155220 with :
156- image : pingcap/pd:nightly
221+ image : us-docker.pkg.dev/ pingcap-testing-account/tidbx/tikv/pd/image:${{ steps.resolve-nextgen-tags.outputs.pd_tag }}
157222 path : /pd-server
158223
159224 - name : Fetch Next-Gen TiKV
160225 uses : shrink/actions-docker-extract@v1
161226 id : extract-tikv
162227 with :
163- image : gcr.io /pingcap-public/dbaas /tikv:dedicated-next-gen
228+ image : us-docker.pkg.dev /pingcap-testing-account/tidbx /tikv/tikv/image:${{ steps.resolve-nextgen-tags.outputs.tikv_tag }}
164229 path : /tikv-server
165230
166231 - name : Run MinIO, PD & Next-Gen TiKV
@@ -178,7 +243,7 @@ jobs:
178243 ./pd-server --config pd_next_gen.toml > pd.log 2>&1 &
179244 sleep 5
180245 ./tikv-server -C tikv_next_gen.toml --pd-endpoints="127.0.0.1:2379" --addr="127.0.0.1:20160" --data-dir=${{ github.workspace }}/integration_tests/tikv-data > tikv.log 2>&1 &
181-
246+
182247 echo "Waiting for servers to start..."
183248 sleep 15
184249
0 commit comments