File tree 3 files changed +14
-5
lines changed
.github/actions/smoke-test
3 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,14 @@ export DOCKER_BUILDKIT=1
7
7
echo " (*) Installing @devcontainer/cli"
8
8
npm install -g @devcontainers/cli
9
9
10
- echo " (*) Building image - ${IMAGE} "
11
10
id_label=" test-container=${IMAGE} "
12
- devcontainer up --id-label ${id_label} --workspace-folder " src/${IMAGE} /"
11
+ id_image=" universal-test-image"
12
+ if [ $IMAGE == " universal" ]; then
13
+ echo " (*) Building image - ${IMAGE} "
14
+ devcontainer build --image-name ${id_image} --workspace-folder " src/${IMAGE} /"
15
+ echo " (*) Starting container - ${IMAGE} "
16
+ devcontainer up --id-label ${id_label} --workspace-folder " src/${IMAGE} /"
17
+ else
18
+ echo " (*) Building image - ${IMAGE} "
19
+ devcontainer up --id-label ${id_label} --workspace-folder " src/${IMAGE} /"
20
+ fi
Original file line number Diff line number Diff line change @@ -32,13 +32,13 @@ install_bc() {
32
32
check_image_size () {
33
33
IMAGE=" $1 "
34
34
THRESHOLD_IN_GB=" $2 "
35
-
35
+ id_image= " $3 "
36
36
# call install_bc
37
37
install_bc
38
38
39
39
if [ $IMAGE == " universal" ]; then
40
40
# Read the image id of the original image, not the modified image with uid and gid
41
- IMAGE_ID=$( docker images | grep -v " uid " | sed ' 1d ' | awk ' {print $3} ' )
41
+ IMAGE_ID=$( docker images -q --filter=reference= " $id_image " )
42
42
else
43
43
CONTAINER_ID=$( docker ps -q --filter " label=test-container=$IMAGE " )
44
44
# Find the image ID of the container
Original file line number Diff line number Diff line change @@ -10,14 +10,15 @@ set -e
10
10
# Run actual test
11
11
echo " (*) Running test..."
12
12
id_label=" test-container=${IMAGE} "
13
+ id_image=" universal-test-image"
13
14
devcontainer exec --workspace-folder $( pwd) /src/$IMAGE --id-label ${id_label} /bin/sh -c ' set -e && if [ -f "test-project/test.sh" ]; then cd test-project && if [ "$(id -u)" = "0" ]; then chmod +x test.sh; else sudo chmod +x test.sh; fi && ./test.sh; else ls -a; fi'
14
15
15
16
echo " (*) Docker image details..."
16
17
docker images
17
18
# Checking size of universal image
18
19
19
20
if [ $IMAGE == " universal" ]; then
20
- check_image_size $IMAGE $THRESHOLD_IN_GB
21
+ check_image_size $IMAGE $THRESHOLD_IN_GB $id_image
21
22
fi
22
23
23
24
# Clean up
You can’t perform that action at this time.
0 commit comments