diff --git a/.github/actions/smoke-test/action.yml b/.github/actions/smoke-test/action.yml index 9d5e7d2..b175013 100644 --- a/.github/actions/smoke-test/action.yml +++ b/.github/actions/smoke-test/action.yml @@ -1,4 +1,5 @@ name: 'Smoke test' +description: 'Builds and smoke-tests a dev container template' inputs: template: description: 'Template to test' @@ -7,10 +8,6 @@ inputs: runs: using: composite steps: - - name: Checkout master - id: checkout_release - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Build template id: build_template shell: bash diff --git a/.github/actions/smoke-test/build.sh b/.github/actions/smoke-test/build.sh index a5b90eb..7d9a76c 100755 --- a/.github/actions/smoke-test/build.sh +++ b/.github/actions/smoke-test/build.sh @@ -13,7 +13,7 @@ pushd "${SRC_DIR}" # Configure templates only if `devcontainer-template.json` contains the `options` property. OPTION_PROPERTY=( $(jq -r '.options' devcontainer-template.json) ) -if [ "${OPTION_PROPERTY}" != "" ] && [ "${OPTION_PROPERTY}" != "null" ] ; then +if [ "${OPTION_PROPERTY}" != "" ] && [ "${OPTION_PROPERTY}" != "null" ] ; then OPTIONS=( $(jq -r '.options | keys[]' devcontainer-template.json) ) if [ "${OPTIONS[0]}" != "" ] && [ "${OPTIONS[0]}" != "null" ] ; then @@ -43,7 +43,7 @@ if [ -d "${TEST_DIR}" ] ; then DEST_DIR="${SRC_DIR}/test-project" mkdir -p ${DEST_DIR} cp -Rp ${TEST_DIR}/* ${DEST_DIR} - cp test/test-utils/test-utils.sh ${DEST_DIR} + cp test/test-utils/* ${DEST_DIR} fi export DOCKER_BUILDKIT=1 diff --git a/test/azure-functions-dotnet/test.sh b/test/azure-functions-dotnet/test.sh index efd8c90..fdf6133 100644 --- a/test/azure-functions-dotnet/test.sh +++ b/test/azure-functions-dotnet/test.sh @@ -1,10 +1,5 @@ #!/bin/bash -cd $(dirname "$0") -source test-utils.sh +set -e -# Template specific tests -check "dotnet" dotnet --version -check "func" func --version - -# Report result -reportResults +cd "$(dirname "$0")" +bash run-template-checks.sh "dotnet" dotnet --version diff --git a/test/azure-functions-java/test.sh b/test/azure-functions-java/test.sh index 18c9b49..dcd1827 100644 --- a/test/azure-functions-java/test.sh +++ b/test/azure-functions-java/test.sh @@ -1,10 +1,5 @@ #!/bin/bash -cd $(dirname "$0") -source test-utils.sh +set -e -# Template specific tests -check "java" java -version -check "func" func --version - -# Report result -reportResults +cd "$(dirname "$0")" +bash run-template-checks.sh "java" java -version diff --git a/test/azure-functions-node/test.sh b/test/azure-functions-node/test.sh index 6d23abd..f03f565 100644 --- a/test/azure-functions-node/test.sh +++ b/test/azure-functions-node/test.sh @@ -1,10 +1,5 @@ #!/bin/bash -cd $(dirname "$0") -source test-utils.sh +set -e -# Template specific tests -check "node" node --version -check "func" func --version - -# Report result -reportResults +cd "$(dirname "$0")" +bash run-template-checks.sh "node" node --version diff --git a/test/azure-functions-powershell/test.sh b/test/azure-functions-powershell/test.sh index 821dcb4..50848a4 100644 --- a/test/azure-functions-powershell/test.sh +++ b/test/azure-functions-powershell/test.sh @@ -1,10 +1,5 @@ #!/bin/bash -cd $(dirname "$0") -source test-utils.sh +set -e -# Template specific tests -check "powershell" pwsh --version -check "func" func --version - -# Report result -reportResults +cd "$(dirname "$0")" +bash run-template-checks.sh "powershell" pwsh --version diff --git a/test/azure-functions-python/test.sh b/test/azure-functions-python/test.sh index 57dbe7d..e438160 100644 --- a/test/azure-functions-python/test.sh +++ b/test/azure-functions-python/test.sh @@ -1,10 +1,5 @@ #!/bin/bash -cd $(dirname "$0") -source test-utils.sh +set -e -# Template specific tests -check "python" python --version -check "func" func --version - -# Report result -reportResults +cd "$(dirname "$0")" +bash run-template-checks.sh "python" python --version diff --git a/test/test-utils/run-template-checks.sh b/test/test-utils/run-template-checks.sh new file mode 100644 index 0000000..a8f1bfc --- /dev/null +++ b/test/test-utils/run-template-checks.sh @@ -0,0 +1,13 @@ +#!/bin/bash +set -e + +cd "$(dirname "$0")" +source test-utils.sh + +LABEL="$1" +shift + +check "$LABEL" "$@" +check "func" func --version + +reportResults