Skip to content

Commit d445d5d

Browse files
committed
add gcp registry to pull image
1 parent cafb72c commit d445d5d

File tree

3 files changed

+433
-0
lines changed

3 files changed

+433
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Generate github actions from template
2+
3+
ytt -f ./gh_template.yml -f [ytt-helpers.star](https://github.com/cloudfoundry/wg-app-platform-runtime-ci/blob/main/shared/helpers/ytt-helpers.star) -f [index.yml](https://github.com/cloudfoundry/wg-app-platform-runtime-ci/blob/main/routing-release/index.yml) > ./workflows/tests-workflow.yml
4+
5+
## Supported jobs
6+
- Template tests
7+
- Basic Verifications
8+
- Unit and Integration tests
Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
#@ load("@ytt:data", "data")
2+
#@ load("ytt-helpers.star", "helpers")
3+
4+
name: unit-integration-tests
5+
6+
on:
7+
8+
pull_request_target:
9+
branches:
10+
- develop
11+
types:
12+
- opened
13+
- reopened
14+
- synchronize
15+
16+
env:
17+
MAPPING: |
18+
build_nats_server=src/code.cloudfoundry.org/vendor/github.com/nats-io/nats-server/v2
19+
build_routing_api_cli=src/code.cloudfoundry.org/routing-api-cli
20+
FLAGS: |
21+
--keep-going
22+
--trace
23+
-r
24+
--fail-on-pending
25+
--randomize-all
26+
--nodes=7
27+
--race
28+
--timeout 30m
29+
--flake-attempts 2
30+
RUN_AS: root
31+
VERIFICATIONS: |
32+
verify_go repo/$DIR
33+
verify_go_version_match_bosh_release repo
34+
verify_gofmt repo/$DIR
35+
verify_govet repo/$DIR
36+
verify_staticcheck repo/$DIR
37+
FUNCTIONS: ci/routing-release/helpers/configure-binaries.bash
38+
39+
jobs:
40+
repo-clone:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: routing-release-repo
44+
uses: actions/checkout@v4
45+
with:
46+
repository: ${{ github.event.pull_request.head.repo.full_name }}
47+
ref: ${{ github.event.pull_request.head.ref }}
48+
submodules: recursive
49+
path: repo
50+
- name: Check out wg-appruntime code
51+
uses: actions/checkout@v4
52+
with:
53+
repository: cloudfoundry/wg-app-platform-runtime-ci
54+
path: ci
55+
- name: zip repo artifacts
56+
run: |
57+
tar -czf repo-artifact.tar.gz repo
58+
tar -czf ci-artifact.tar.gz ci
59+
- name: upload artifact
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: repo
63+
path: |
64+
repo-artifact.tar.gz
65+
ci-artifact.tar.gz
66+
template-tests:
67+
runs-on: ubuntu-latest
68+
needs: repo-clone
69+
container:
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 }}
74+
steps:
75+
- name: Download artifact
76+
uses: actions/download-artifact@v4
77+
with:
78+
name: repo
79+
- run: "tar -xzvf repo-artifact.tar.gz\ntar -xzvf ci-artifact.tar.gz\n"
80+
- name: template-tests
81+
run: |
82+
"${GITHUB_WORKSPACE}"/ci/shared/tasks/run-tests-templates/task.bash
83+
test-on-mysql-5-7:
84+
runs-on: ubuntu-latest
85+
needs: repo-clone
86+
container:
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 }}
91+
steps:
92+
- name: Download artifact
93+
uses: actions/download-artifact@v4
94+
with:
95+
name: repo
96+
- run: |
97+
tar -xzvf repo-artifact.tar.gz
98+
tar -xzvf ci-artifact.tar.gz
99+
- name: build binaries
100+
run: |
101+
export DEFAULT_PARAMS="${GITHUB_WORKSPACE}/ci/routing-release/default-params/build-binaries/linux.yml"
102+
"${GITHUB_WORKSPACE}"/ci/shared/tasks/build-binaries/task.bash
103+
#@ for package in helpers.packages_with_configure_db(data.values.internal_repos):
104+
- name: #@ "{}-mysql".format(package.name)
105+
env:
106+
DIR: #@ "src/code.cloudfoundry.org/{}".format(package.name)
107+
DB: mysql
108+
run: |
109+
"${GITHUB_WORKSPACE}"/ci/routing-release/helpers/configure-binaries.bash
110+
"${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
111+
#@ end
112+
test-repos-withoutdb:
113+
runs-on: ubuntu-latest
114+
needs: repo-clone
115+
container:
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 }}
120+
steps:
121+
- name: Download artifact
122+
uses: actions/download-artifact@v4
123+
with:
124+
name: repo
125+
- run: |
126+
tar -xzvf repo-artifact.tar.gz
127+
tar -xzvf ci-artifact.tar.gz
128+
- name: build binaries
129+
run: |
130+
export DEFAULT_PARAMS="${GITHUB_WORKSPACE}/ci/routing-release/default-params/build-binaries/linux.yml"
131+
"${GITHUB_WORKSPACE}"/ci/shared/tasks/build-binaries/task.bash
132+
#@ for package in helpers.packages_without_configure_db(data.values.internal_repos):
133+
- name: #@ package.name
134+
env:
135+
DIR: #@ "src/code.cloudfoundry.org/{}".format(package.name)
136+
run: |
137+
export DIR=$DIR
138+
"${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
139+
#@ end
140+
test-on-postgres:
141+
runs-on: ubuntu-latest
142+
needs: repo-clone
143+
container:
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 }}
148+
steps:
149+
- name: Download artifact
150+
uses: actions/download-artifact@v4
151+
with:
152+
name: repo
153+
- run: |
154+
tar -xzvf repo-artifact.tar.gz
155+
tar -xzvf ci-artifact.tar.gz
156+
- name: build binaries
157+
run: |
158+
export DEFAULT_PARAMS="${GITHUB_WORKSPACE}/ci/routing-release/default-params/build-binaries/linux.yml"
159+
"${GITHUB_WORKSPACE}"/ci/shared/tasks/build-binaries/task.bash
160+
#@ for package in helpers.packages_with_configure_db(data.values.internal_repos):
161+
- name: #@ "{}-mysql".format(package.name)
162+
env:
163+
DIR: #@ "src/code.cloudfoundry.org/{}".format(package.name)
164+
DB: postgres
165+
run: |
166+
"${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
167+
#@ end
168+
test-on-mysql-8-0:
169+
runs-on: ubuntu-latest
170+
needs: repo-clone
171+
container:
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 }}
176+
steps:
177+
- name: Download artifact
178+
uses: actions/download-artifact@v4
179+
with:
180+
name: repo
181+
- run: |
182+
tar -xzvf repo-artifact.tar.gz
183+
tar -xzvf ci-artifact.tar.gz
184+
- name: build binaries
185+
run: |
186+
export DEFAULT_PARAMS="${GITHUB_WORKSPACE}/ci/routing-release/default-params/build-binaries/linux.yml"
187+
"${GITHUB_WORKSPACE}"/ci/shared/tasks/build-binaries/task.bash
188+
#@ for package in helpers.packages_with_configure_db(data.values.internal_repos):
189+
- name: #@ "{}-mysql".format(package.name)
190+
env:
191+
DIR: #@ "src/code.cloudfoundry.org/{}".format(package.name)
192+
DB: mysql
193+
run: |
194+
"${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
195+
#@ end

0 commit comments

Comments
 (0)