diff --git a/Dockerfile b/Dockerfile index eb3f9a6..36e827c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM base +FROM base AS run # Libuv 1.45.0 is affected by a kernel bug on certain kernels. # This leads to errors where Garden tool downloading errors with ETXTBSY @@ -49,3 +49,12 @@ RUN npm install -g pnpm@10 USER skpr ENV PATH /data/node_modules/.bin:$PATH + +# Temporary build stage where we can run the test suite. +FROM run AS test +COPY --from=ghcr.io/goss-org/goss:latest /usr/bin/goss /usr/bin/goss +ADD goss.yml /etc/goss/goss.yml +RUN goss --gossfile=/etc/goss/goss.yml validate + +# Swap back to the run stage. +FROM run diff --git a/goss.yml b/goss.yml new file mode 100644 index 0000000..23ae89f --- /dev/null +++ b/goss.yml @@ -0,0 +1,18 @@ +command: + npm: + exec: "npm --help" + exit-status: 1 + stdout: + - DISCLAIMER + + yarn: + exec: "yarn --help" + exit-status: 0 + stdout: + - DISCLAIMER + + pnpm: + exec: "pnpm --help" + exit-status: 0 + stdout: + - "compiled to binary" diff --git a/tests.yml b/tests.yml deleted file mode 100644 index 4b6856f..0000000 --- a/tests.yml +++ /dev/null @@ -1,20 +0,0 @@ -schemaVersion: '2.0.0' - -commandTests: - - name: "npm" - command: "npm" - args: ["--help"] - expectedOutput: ["DISCLAIMER"] - exitCode: 1 - - - name: "yarn" - command: "yarn" - args: ["--help"] - expectedOutput: ["DISCLAIMER"] - exitCode: 0 - - - name: "pnpm" - command: "pnpm" - args: ["--help"] - expectedOutput: ["compiled to binary"] - exitCode: 0