From ec35446b659063d12cb0567e072a1575a71c20cb Mon Sep 17 00:00:00 2001 From: Tobias Genannt Date: Thu, 21 Jul 2022 08:47:56 +0200 Subject: [PATCH] Skip initializer tests for pre-releases --- .github/workflows/release.yml | 4 ++++ test.sh | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b622ea..354a64b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,6 +43,10 @@ jobs: - id: docker-build name: Build the image with '${{ matrix.build_cmd }}' run: ${{ matrix.build_cmd }} + - id: test-configuration + name: Set ENV variable to skip initializer tests for prereleases + if: ${{ contains(matrix.build_cmd, 'PRERELEASE=true') || contains(matrix.build_cmd, 'feature') }} + run: echo "SKIP_INITIALIZER_TESTS=true" >>"${GITHUB_ENV}" - id: test-image name: Test the image run: IMAGE="${FINAL_DOCKER_TAG}" ./test.sh diff --git a/test.sh b/test.sh index d2091e4..5926f13 100755 --- a/test.sh +++ b/test.sh @@ -14,6 +14,8 @@ # exit when a command exits with an exit code != 0 set -e +source ./build-functions/gh-functions.sh + # IMAGE is used by `docker-compose.yml` do determine the tag # of the Docker Image that is to be used if [ "${1}x" != "x" ]; then @@ -80,7 +82,16 @@ echo "🐳🐳🐳 Start testing '${IMAGE}'" trap test_cleanup EXIT ERR test_setup +gh_echo "::group::Netbox unit tests" test_netbox_unit_tests -test_initializers +gh_echo "::endgroup::" + +gh_echo "::group::Innitializer tests" +if [ "$SKIP_INITIALIZER_TESTS" == "true" ]; then + echo "↩️ Skipping initializer tests" +else + test_initializers +fi +gh_echo "::endgroup::" echo "🐳🐳🐳 Done testing '${IMAGE}'"