3434 uses : docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
3535 - name : Install Goss and dgoss
3636 run : |
37- curl -fsSL https://goss.rocks/install | sh
38- export PATH=$PATH:/usr/local/bin
37+ set -euo pipefail
38+
39+ VERSION="v0.4.9"
40+ BIN_DIR="$HOME/.local/bin"
41+
42+ mkdir -p "$BIN_DIR"
43+ echo "$BIN_DIR" >> "$GITHUB_PATH"
44+
45+ ARCH="${{ matrix.platform }}"
46+ if [ "$ARCH" != "amd64" ] && [ "$ARCH" != "arm64" ]; then
47+ echo "Unsupported platform: $ARCH"
48+ exit 1
49+ fi
50+
51+ curl -fsSL \
52+ -o "$BIN_DIR/goss" \
53+ "https://github.com/goss-org/goss/releases/download/${VERSION}/goss-linux-${ARCH}"
54+
55+ curl -fsSL \
56+ -o "$BIN_DIR/dgoss" \
57+ "https://github.com/goss-org/goss/releases/download/${VERSION}/dgoss"
58+
59+ chmod +x "$BIN_DIR/goss" "$BIN_DIR/dgoss"
60+
61+ "$BIN_DIR/goss" --version
3962 - name : Get current Git SHA
4063 id : vars
4164 run : echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
78101 echo "oscodename: ${{ matrix.release }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
79102 echo "arch: ${{ matrix.platform }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
80103 # test the edge case from deregistration on reusable runners
81- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_reusage_fail.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
104+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_reusage_fail.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep \
82105 -e DEBUG_ONLY=true \
83106 -e ACCESS_TOKEN=notreal \
84107 -e LABELS=linux,x64 \
@@ -93,17 +116,17 @@ jobs:
93116 exit 1
94117 fi
95118 # test the base
96- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
119+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
97120 if [ $? -ne 0 ]; then
98121 exit 1
99122 fi
100123 # test the final image but with all defaults
101- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full_defaults.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
124+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full_defaults.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
102125 if [ $? -ne 0 ]; then
103126 exit 1
104127 fi
105128 # test the final image but with non-default values
106- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
129+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep \
107130 -e DEBUG_ONLY=true \
108131 -e RUNNER_NAME=huzzah \
109132 -e REPO_URL=https://github.com/myoung34/docker-github-actions-runner \
@@ -129,7 +152,7 @@ jobs:
129152 exit 1
130153 fi
131154 # test the EXIT trap on process crash
132- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_trap_exit.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
155+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_trap_exit.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep \
133156 -e DEBUG_ONLY=false \
134157 -e REPO_URL=https://github.com/fake/repo \
135158 -e RUNNER_TOKEN=faketoken \
@@ -140,7 +163,7 @@ jobs:
140163 exit 1
141164 fi
142165 # test RUNNER_WORKDIR_ROOT overrides the /_work base for the default per-runner workdir
143- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_workdir_root.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
166+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_workdir_root.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep \
144167 -e DEBUG_ONLY=true \
145168 -e REPO_URL=https://github.com/fake/repo \
146169 -e RUNNER_NAME=test \
@@ -169,8 +192,31 @@ jobs:
169192 uses : docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
170193 - name : Install Goss and dgoss
171194 run : |
172- curl -fsSL https://goss.rocks/install | sh
173- export PATH=$PATH:/usr/local/bin
195+ set -euo pipefail
196+
197+ VERSION="v0.4.9"
198+ BIN_DIR="$HOME/.local/bin"
199+
200+ mkdir -p "$BIN_DIR"
201+ echo "$BIN_DIR" >> "$GITHUB_PATH"
202+
203+ ARCH="${{ matrix.platform }}"
204+ if [ "$ARCH" != "amd64" ] && [ "$ARCH" != "arm64" ]; then
205+ echo "Unsupported platform: $ARCH"
206+ exit 1
207+ fi
208+
209+ curl -fsSL \
210+ -o "$BIN_DIR/goss" \
211+ "https://github.com/goss-org/goss/releases/download/${VERSION}/goss-linux-${ARCH}"
212+
213+ curl -fsSL \
214+ -o "$BIN_DIR/dgoss" \
215+ "https://github.com/goss-org/goss/releases/download/${VERSION}/dgoss"
216+
217+ chmod +x "$BIN_DIR/goss" "$BIN_DIR/dgoss"
218+
219+ "$BIN_DIR/goss" --version
174220 - name : Get current Git SHA
175221 id : vars
176222 run : echo "GIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
@@ -213,7 +259,7 @@ jobs:
213259 echo "oscodename: ${{ matrix.release }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
214260 echo "arch: ${{ matrix.platform }}" >>goss_vars_${GH_RUNNER_IMAGE}.yaml
215261 # test the edge case from deregistration on reusable runners
216- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_reusage_fail.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
262+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_reusage_fail.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep \
217263 -e DEBUG_ONLY=true \
218264 -e ACCESS_TOKEN=notreal \
219265 -e LABELS=linux,x64 \
@@ -228,11 +274,11 @@ jobs:
228274 exit 1
229275 fi
230276 # test the base
231- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
277+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_base.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
232278 # test the final image but with all defaults
233- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full_defaults.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
279+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full_defaults.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep -e RUNNER_NAME=test -e DEBUG_ONLY=true ${GH_RUNNER_IMAGE} 10
234280 # test the final image but with non-default values
235- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
281+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_full.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep \
236282 -e DEBUG_ONLY=true \
237283 -e RUNNER_NAME=huzzah \
238284 -e REPO_URL=https://github.com/myoung34/docker-github-actions-runner \
@@ -255,7 +301,7 @@ jobs:
255301 -e DISABLE_AUTO_UPDATE=true \
256302 ${GH_RUNNER_IMAGE} 10
257303 # test the EXIT trap on process crash
258- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_trap_exit.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
304+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_trap_exit.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep \
259305 -e DEBUG_ONLY=false \
260306 -e REPO_URL=https://github.com/fake/repo \
261307 -e RUNNER_TOKEN=faketoken \
@@ -266,7 +312,7 @@ jobs:
266312 exit 1
267313 fi
268314 # test RUNNER_WORKDIR_ROOT overrides the /_work base for the default per-runner workdir
269- GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_workdir_root.yaml GOSS_SLEEP=1 dgoss run --entrypoint /usr/bin/sleep \
315+ GOSS_VARS=goss_vars_${GH_RUNNER_IMAGE}.yaml GOSS_FILE=goss_workdir_root.yaml GOSS_SLEEP=1 $HOME/.local/bin/ dgoss run --entrypoint /usr/bin/sleep \
270316 -e DEBUG_ONLY=true \
271317 -e REPO_URL=https://github.com/fake/repo \
272318 -e RUNNER_NAME=test \
0 commit comments