Skip to content

Commit 51aacf3

Browse files
committed
add pull request target to develop branch and support to pull gcp image
1 parent 0abfba9 commit 51aacf3

File tree

2 files changed

+55
-23
lines changed

2 files changed

+55
-23
lines changed

.github/gh-config-template/gh_template.yml

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
name: unit-integration-tests
55

66
on:
7-
push:
8-
branches:
9-
- develop
10-
pull_request:
7+
8+
pull_request_target:
9+
branches:
10+
- develop
11+
types:
12+
- opened
13+
- reopened
14+
- synchronize
1115

1216
env:
1317
MAPPING: |
@@ -39,8 +43,8 @@ jobs:
3943
- name: routing-release-repo
4044
uses: actions/checkout@v4
4145
with:
42-
repository: cloudfoundry/routing-release.git
43-
ref: github-action
46+
repository: ${{ github.event.pull_request.head.repo.full_name }}
47+
ref: ${{ github.event.pull_request.head.ref }}
4448
submodules: recursive
4549
path: repo
4650
- name: Check out wg-appruntime code
@@ -63,7 +67,10 @@ jobs:
6367
runs-on: ubuntu-latest
6468
needs: repo-clone
6569
container:
66-
image: cloudfoundry/tas-runtime-mysql-5.7
70+
image: us-central1-docker.pkg.dev/cf-diego-pivotal/tas-runtime-dockerhub-mirror/cloudfoundry/tas-runtime-build
71+
credentials:
72+
username: _json_key
73+
password: ${{ secrets.GCP_SERVICE_ACCOUNT_TAS_RUNTIME_BUILD_IMAGE_READER }}
6774
steps:
6875
- name: Download artifact
6976
uses: actions/download-artifact@v4
@@ -77,15 +84,18 @@ jobs:
7784
runs-on: ubuntu-latest
7885
needs: repo-clone
7986
container:
80-
image: cloudfoundry/tas-runtime-mysql-5.7
87+
image: us-central1-docker.pkg.dev/cf-diego-pivotal/tas-runtime-dockerhub-mirror/cloudfoundry/tas-runtime-mysql-5.7
88+
credentials:
89+
username: _json_key
90+
password: ${{ secrets.GCP_SERVICE_ACCOUNT_TAS_RUNTIME_BUILD_IMAGE_READER }}
8191
steps:
8292
- name: Download artifact
8393
uses: actions/download-artifact@v4
8494
with:
8595
name: repo
8696
- run: |
87-
tar -xzvf repo-artifact.tar.gz
88-
tar -xzvf ci-artifact.tar.gz
97+
tar -xzvf repo-artifact.tar.gz
98+
tar -xzvf ci-artifact.tar.gz
8999
- name: build binaries
90100
run: |
91101
export DEFAULT_PARAMS="${GITHUB_WORKSPACE}/ci/routing-release/default-params/build-binaries/linux.yml"
@@ -103,7 +113,10 @@ jobs:
103113
runs-on: ubuntu-latest
104114
needs: repo-clone
105115
container:
106-
image: cloudfoundry/tas-runtime-build
116+
image: us-central1-docker.pkg.dev/cf-diego-pivotal/tas-runtime-dockerhub-mirror/cloudfoundry/tas-runtime-build
117+
credentials:
118+
username: _json_key
119+
password: ${{ secrets.GCP_SERVICE_ACCOUNT_TAS_RUNTIME_BUILD_IMAGE_READER }}
107120
steps:
108121
- name: Download artifact
109122
uses: actions/download-artifact@v4
@@ -128,7 +141,10 @@ jobs:
128141
runs-on: ubuntu-latest
129142
needs: repo-clone
130143
container:
131-
image: cloudfoundry/tas-runtime-postgres
144+
image: us-central1-docker.pkg.dev/cf-diego-pivotal/tas-runtime-dockerhub-mirror/cloudfoundry/tas-runtime-postgres
145+
credentials:
146+
username: _json_key
147+
password: ${{ secrets.GCP_SERVICE_ACCOUNT_TAS_RUNTIME_BUILD_IMAGE_READER }}
132148
steps:
133149
- name: Download artifact
134150
uses: actions/download-artifact@v4
@@ -153,7 +169,10 @@ jobs:
153169
runs-on: ubuntu-latest
154170
needs: repo-clone
155171
container:
156-
image: cloudfoundry/tas-runtime-mysql-8.0
172+
image: us-central1-docker.pkg.dev/cf-diego-pivotal/tas-runtime-dockerhub-mirror/cloudfoundry/tas-runtime-mysql-8.0
173+
credentials:
174+
username: _json_key
175+
password: ${{ secrets.GCP_SERVICE_ACCOUNT_TAS_RUNTIME_BUILD_IMAGE_READER }}
157176
steps:
158177
- name: Download artifact
159178
uses: actions/download-artifact@v4

.github/workflows/tests-workflow.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name: unit-integration-tests
22
on:
3-
push:
3+
pull_request_target:
44
branches:
55
- develop
6-
pull_request:
7-
6+
types:
7+
- opened
8+
- reopened
9+
- synchronize
810
env:
911
MAPPING: |
1012
build_nats_server=src/code.cloudfoundry.org/vendor/github.com/nats-io/nats-server/v2
@@ -34,8 +36,8 @@ jobs:
3436
- name: routing-release-repo
3537
uses: actions/checkout@v4
3638
with:
37-
repository: cloudfoundry/routing-release.git
38-
ref: develop
39+
repository: ${{ github.event.pull_request.head.repo.full_name }}
40+
ref: ${{ github.event.pull_request.head.ref }}
3941
submodules: recursive
4042
path: repo
4143
- name: Check out wg-appruntime code
@@ -67,7 +69,9 @@ jobs:
6769
uses: actions/download-artifact@v4
6870
with:
6971
name: repo
70-
- run: "tar -xzvf repo-artifact.tar.gz\ntar -xzvf ci-artifact.tar.gz\n"
72+
- run: |
73+
tar -xzvf repo-artifact.tar.gz
74+
tar -xzvf ci-artifact.tar.gz
7175
- name: template-tests
7276
run: |
7377
"${GITHUB_WORKSPACE}"/ci/shared/tasks/run-tests-templates/task.bash
@@ -84,7 +88,7 @@ jobs:
8488
uses: actions/download-artifact@v4
8589
with:
8690
name: repo
87-
- run: "tar -xzvf repo-artifact.tar.gz\ntar -xzvf ci-artifact.tar.gz\n"
91+
- run: "tar -xzvf repo-artifact.tar.gz\ntar -xzvf ci-artifact.tar.gz \n"
8892
- name: build binaries
8993
run: |
9094
export DEFAULT_PARAMS="${GITHUB_WORKSPACE}/ci/routing-release/default-params/build-binaries/linux.yml"
@@ -94,18 +98,21 @@ jobs:
9498
DIR: src/code.cloudfoundry.org/gorouter
9599
DB: mysql
96100
run: |
101+
"${GITHUB_WORKSPACE}"/ci/routing-release/helpers/configure-binaries.bash
97102
"${GITHUB_WORKSPACE}"/ci/shared/tasks/run-bin-test/task.bash --keep-going --trace -r --fail-on-pending --randomize-all --nodes=7 --race --timeout 30m --flake-attempts 2
98103
- name: cf-tcp-router-mysql
99104
env:
100105
DIR: src/code.cloudfoundry.org/cf-tcp-router
101106
DB: mysql
102107
run: |
108+
"${GITHUB_WORKSPACE}"/ci/routing-release/helpers/configure-binaries.bash
103109
"${GITHUB_WORKSPACE}"/ci/shared/tasks/run-bin-test/task.bash --keep-going --trace -r --fail-on-pending --randomize-all --nodes=7 --race --timeout 30m --flake-attempts 2
104110
- name: routing-api-mysql
105111
env:
106112
DIR: src/code.cloudfoundry.org/routing-api
107113
DB: mysql
108114
run: |
115+
"${GITHUB_WORKSPACE}"/ci/routing-release/helpers/configure-binaries.bash
109116
"${GITHUB_WORKSPACE}"/ci/shared/tasks/run-bin-test/task.bash --keep-going --trace -r --fail-on-pending --randomize-all --nodes=7 --race --timeout 30m --flake-attempts 2
110117
test-repos-withoutdb:
111118
runs-on: ubuntu-latest
@@ -120,7 +127,9 @@ jobs:
120127
uses: actions/download-artifact@v4
121128
with:
122129
name: repo
123-
- run: "tar -xzvf repo-artifact.tar.gz\ntar -xzvf ci-artifact.tar.gz\n"
130+
- run: |
131+
tar -xzvf repo-artifact.tar.gz
132+
tar -xzvf ci-artifact.tar.gz
124133
- name: build binaries
125134
run: |
126135
export DEFAULT_PARAMS="${GITHUB_WORKSPACE}/ci/routing-release/default-params/build-binaries/linux.yml"
@@ -156,7 +165,9 @@ jobs:
156165
uses: actions/download-artifact@v4
157166
with:
158167
name: repo
159-
- run: "tar -xzvf repo-artifact.tar.gz\ntar -xzvf ci-artifact.tar.gz\n"
168+
- run: |
169+
tar -xzvf repo-artifact.tar.gz
170+
tar -xzvf ci-artifact.tar.gz
160171
- name: build binaries
161172
run: |
162173
export DEFAULT_PARAMS="${GITHUB_WORKSPACE}/ci/routing-release/default-params/build-binaries/linux.yml"
@@ -192,7 +203,9 @@ jobs:
192203
uses: actions/download-artifact@v4
193204
with:
194205
name: repo
195-
- run: "tar -xzvf repo-artifact.tar.gz\ntar -xzvf ci-artifact.tar.gz\n"
206+
- run: |
207+
tar -xzvf repo-artifact.tar.gz
208+
tar -xzvf ci-artifact.tar.gz
196209
- name: build binaries
197210
run: |
198211
export DEFAULT_PARAMS="${GITHUB_WORKSPACE}/ci/routing-release/default-params/build-binaries/linux.yml"

0 commit comments

Comments
 (0)