Skip to content

Commit 6563323

Browse files
committedJul 3, 2024
Merge jobs test, build & run for x86 again
1 parent b9bf744 commit 6563323

File tree

1 file changed

+25
-34
lines changed

1 file changed

+25
-34
lines changed
 

‎.github/workflows/build_test_push.yaml

+25-34
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,21 @@ jobs:
7676
echo "is_highest=false" >> $GITHUB_ENV
7777
fi
7878
79-
integration-test-x86:
79+
build-test-push-x86:
8080
runs-on: ubuntu-latest
81-
if: ${{ inputs.skip_test == 'false' }}
8281
needs: [check-git]
8382
steps:
8483
- uses: actions/checkout@v4
8584

85+
- name: Login to Dockerhub
86+
uses: docker/login-action@v2
87+
if: github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')
88+
with:
89+
username: hopsworks
90+
password: ${{ secrets.DOCKERHUB_TOKEN }}
91+
8692
- name: Build and run Docker Compose cluster with benchmarking
93+
if: ${{ inputs.skip_test == 'false' }}
8794
run: |
8895
./run.sh -lv \
8996
--rondb-tarball-url $BASE_DOWNLOAD_URL/${{ inputs.rondb_x86_tarball_name }} \
@@ -93,6 +100,7 @@ jobs:
93100
--detached
94101
95102
- name: Wait for one container exit or timeout
103+
if: ${{ inputs.skip_test == 'false' }}
96104
run: |
97105
start=`date +%s`
98106
while true; do
@@ -111,17 +119,24 @@ jobs:
111119
done
112120
113121
- run: docker container ls
122+
if: ${{ inputs.skip_test == 'false' }}
114123
- run: docker logs mgmd_1
124+
if: ${{ inputs.skip_test == 'false' }}
115125
- run: docker logs ndbd_1
126+
if: ${{ inputs.skip_test == 'false' }}
116127
- run: docker logs mysqld_1
128+
if: ${{ inputs.skip_test == 'false' }}
117129
- run: docker logs rest_1
130+
if: ${{ inputs.skip_test == 'false' }}
118131
- run: docker logs bench_1
132+
if: ${{ inputs.skip_test == 'false' }}
119133

120134
# At this point we only know that one container has exited. We want to
121135
# check whether the bench container has exited with exit code 0. We need
122136
# both status and exit code to do so, since Docker reports exit code 0
123137
# for running containers.
124138
- name: Check Benchmarking Exit Code
139+
if: ${{ inputs.skip_test == 'false' }}
125140
run: |
126141
if [ "$(docker inspect bench_1 --format='{{.State.Status}}')" != "exited" ]
127142
then
@@ -136,16 +151,11 @@ jobs:
136151
fi
137152
138153
- name: Printing Sysbench results
154+
if: ${{ inputs.skip_test == 'false' }}
139155
run: cat autogenerated_files/*/volumes/sysbench_single/final_result.txt
140156

141-
build-x86:
142-
runs-on: ubuntu-latest
143-
if: ${{ inputs.skip_test == 'true' }}
144-
steps:
145-
- uses: actions/checkout@v4
146-
147157
- name: Build X86 image
148-
if: github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')
158+
if: ${{ inputs.skip_test == 'true' }} && github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')
149159
run: |
150160
VERSION="$(sed -e 's/^[[:space:]]*//' -e '/-SNAPSHOT$/s/.*/dev/' ./VERSION)"
151161
docker buildx build . \
@@ -154,36 +164,17 @@ jobs:
154164
--build-arg RONDB_TARBALL_LOCAL_REMOTE=remote \
155165
--build-arg RONDB_X86_TARBALL_URI=$BASE_DOWNLOAD_URL/${{ inputs.rondb_x86_tarball_name }}
156166
157-
# TODO: This doesn't have access to the images of the previous jobs
158-
push-x86:
159-
runs-on: ubuntu-latest
160-
# It's always EITHER one or the other that will be run
161-
# https://github.com/actions/runner/issues/491#issuecomment-850884422
162-
needs: [check-git, integration-test-x86, build-x86]
163-
if: |
164-
always() &&
165-
(needs.integration-test-x86.result == 'success' || needs.integration-test-x86.result == 'skipped') &&
166-
(needs.build-x86.result == 'success' || needs.build-x86.result == 'skipped') &&
167-
github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')
168-
steps:
169-
- uses: actions/checkout@v4
170-
171-
- name: Login to Dockerhub
172-
uses: docker/login-action@v2
173-
with:
174-
username: hopsworks
175-
password: ${{ secrets.DOCKERHUB_TOKEN }}
176-
177167
- name: Push standard versioned image
168+
if: github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')
178169
run: |
179170
VERSION="$(sed -e 's/^[[:space:]]*//' -e '/-SNAPSHOT$/s/.*/dev/' ./VERSION)"
180171
IMAGE_NAME=hopsworks/$X86_IMAGE_NAME:${{ inputs.rondb_version }}-$VERSION
181172
182173
docker tag rondb-standalone:${{ inputs.rondb_version }}-$VERSION $IMAGE_NAME
183174
docker push $IMAGE_NAME
184175
185-
# Our "latest" branch points to the latest *release* branch.
186-
- name: Push with "latest" tag (omit rondb-docker version)
176+
- name: Push with tag `<rondb-version>-latest`
177+
# Our "latest" branch points to the latest *release* branch.
187178
if: needs.check-git.outputs.is_highest_release == 'true'
188179
run: |
189180
VERSION="$(sed -e 's/^[[:space:]]*//' -e '/-SNAPSHOT$/s/.*/dev/' ./VERSION)"
@@ -192,7 +183,7 @@ jobs:
192183
docker tag rondb-standalone:${{ inputs.rondb_version }}-$VERSION $IMAGE_NAME
193184
docker push $IMAGE_NAME
194185
195-
- name: Push with "latest" tag (also omit rondb version)
186+
- name: Push with tag `latest`
196187
if: needs.check-git.outputs.is_highest_release == 'true' && ${{ inputs.is_latest_rondb_release == 'true' }}
197188
run: |
198189
VERSION="$(sed -e 's/^[[:space:]]*//' -e '/-SNAPSHOT$/s/.*/dev/' ./VERSION)"
@@ -201,7 +192,7 @@ jobs:
201192
docker tag rondb-standalone:${{ inputs.rondb_version }}-$VERSION $IMAGE_NAME
202193
docker push $IMAGE_NAME
203194
204-
build-and-push-ARM64:
195+
build-push-arm64:
205196
runs-on: ubuntu-latest
206197
if: github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')
207198
needs: [check-git]
@@ -247,7 +238,7 @@ jobs:
247238
make-multi-platform-image:
248239
runs-on: ubuntu-latest
249240
if: github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')
250-
needs: [check-git, push-x86, build-and-push-ARM64]
241+
needs: [check-git, build-test-push-x86, build-push-arm64]
251242
steps:
252243
- uses: actions/checkout@v4
253244

0 commit comments

Comments
 (0)