@@ -2,9 +2,7 @@ name: Build, test & push executor
2
2
3
3
on :
4
4
workflow_call :
5
- # WARNING:
6
- # 1. Duplicate everything here into workflow_dispatch
7
- # 2. Type "boolean" is not supported
5
+ # WARNING: Duplicate everything here into workflow_dispatch
8
6
inputs :
9
7
rondb_version :
10
8
required : true
18
16
is_latest_rondb_release :
19
17
required : true
20
18
description : " Used to decide whether the Docker image will be using the 'latest' tag without a version number"
21
- type : string
22
- default : ' false'
19
+ type : boolean
20
+ default : false
23
21
skip_test :
24
22
required : true
25
- type : string
26
- default : ' false'
23
+ type : boolean
24
+ default : false
27
25
# Inputs here have to be duplicated from workflow_call...
28
26
# https://github.com/orgs/community/discussions/39357
29
27
workflow_dispatch :
40
38
is_latest_rondb_release :
41
39
required : true
42
40
description : " Used to decide whether the Docker image will be using the 'latest' tag without a version number"
43
- type : string
44
- default : ' false'
41
+ type : boolean
42
+ default : false
45
43
skip_test :
46
44
required : true
47
- type : string
48
- default : ' false'
45
+ type : boolean
46
+ default : false
49
47
50
48
env :
51
49
BASE_DOWNLOAD_URL : https://repo.hops.works/master
57
55
runs-on : ubuntu-latest
58
56
# This will block all other jobs from running due to "needs"
59
57
if : |
60
- ${{ inputs.skip_test == 'false' || (
58
+ ${{ ! inputs.skip_test || (
61
59
github.repository == 'logicalclocks/rondb-docker' &&
62
60
(startsWith(github.ref_name, 'release-') || github.ref_name == 'main')
63
61
)}}
96
94
password : ${{ secrets.DOCKERHUB_TOKEN }}
97
95
98
96
- name : Build and run Docker Compose cluster with benchmarking
99
- if : ${{ inputs.skip_test == 'false' }}
97
+ if : ${{ ! inputs.skip_test }}
100
98
run : |
101
99
./run.sh -lv \
102
100
--rondb-tarball-url $BASE_DOWNLOAD_URL/${{ inputs.rondb_x86_tarball_name }} \
@@ -106,7 +104,7 @@ jobs:
106
104
--detached
107
105
108
106
- name : Wait for one container exit or timeout
109
- if : ${{ inputs.skip_test == 'false' }}
107
+ if : ${{ ! inputs.skip_test }}
110
108
run : |
111
109
start=`date +%s`
112
110
while true; do
@@ -125,24 +123,24 @@ jobs:
125
123
done
126
124
127
125
- run : docker container ls
128
- if : ${{ inputs.skip_test == 'false' }}
126
+ if : ${{ ! inputs.skip_test }}
129
127
- run : docker logs mgmd_1
130
- if : ${{ inputs.skip_test == 'false' }}
128
+ if : ${{ ! inputs.skip_test }}
131
129
- run : docker logs ndbd_1
132
- if : ${{ inputs.skip_test == 'false' }}
130
+ if : ${{ ! inputs.skip_test }}
133
131
- run : docker logs mysqld_1
134
- if : ${{ inputs.skip_test == 'false' }}
132
+ if : ${{ ! inputs.skip_test }}
135
133
- run : docker logs rest_1
136
- if : ${{ inputs.skip_test == 'false' }}
134
+ if : ${{ ! inputs.skip_test }}
137
135
- run : docker logs bench_1
138
- if : ${{ inputs.skip_test == 'false' }}
136
+ if : ${{ ! inputs.skip_test }}
139
137
140
138
# At this point we only know that one container has exited. We want to
141
139
# check whether the bench container has exited with exit code 0. We need
142
140
# both status and exit code to do so, since Docker reports exit code 0
143
141
# for running containers.
144
142
- name : Check Benchmarking Exit Code
145
- if : ${{ inputs.skip_test == 'false' }}
143
+ if : ${{ ! inputs.skip_test }}
146
144
run : |
147
145
if [ "$(docker inspect bench_1 --format='{{.State.Status}}')" != "exited" ]
148
146
then
@@ -157,11 +155,11 @@ jobs:
157
155
fi
158
156
159
157
- name : Printing Sysbench results
160
- if : ${{ inputs.skip_test == 'false' }}
158
+ if : ${{ ! inputs.skip_test }}
161
159
run : cat autogenerated_files/*/volumes/sysbench_single/final_result.txt
162
160
163
161
- name : Build X86 image
164
- if : ${{ inputs.skip_test == 'true' && github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')}}
162
+ if : ${{ inputs.skip_test && github.repository == 'logicalclocks/rondb-docker' && (startsWith(github.ref_name, 'release-') || github.ref_name == 'main')}}
165
163
run : |
166
164
VERSION="$(sed -e 's/^[[:space:]]*//' -e '/-SNAPSHOT$/s/.*/dev/' ./VERSION)"
167
165
docker buildx build . \
@@ -190,7 +188,7 @@ jobs:
190
188
docker push $IMAGE_NAME
191
189
192
190
- name : Push with tag `latest`
193
- if : ${{ needs.check-git.outputs.is_highest_release == 'true' && inputs.is_latest_rondb_release == 'true' }}
191
+ if : ${{ needs.check-git.outputs.is_highest_release && inputs.is_latest_rondb_release }}
194
192
run : |
195
193
VERSION="$(sed -e 's/^[[:space:]]*//' -e '/-SNAPSHOT$/s/.*/dev/' ./VERSION)"
196
194
IMAGE_NAME=hopsworks/$X86_IMAGE_NAME:latest
0 commit comments