From 0533abe914869e89963fad3388c86edbbaadc9a1 Mon Sep 17 00:00:00 2001 From: Shizun Ge Date: Wed, 24 Jan 2024 20:22:12 -0800 Subject: [PATCH] fix TAG used in post push test. --- .github/workflows/on-push.yml | 2 +- .github/workflows/on-release.yml | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index e4d5152..ec78b7e 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -108,7 +108,7 @@ jobs: - name: Post push tests run: | echo "Start running tests"; - TAG=$(echo "${{ steps.meta.outputs.tags }}" | grep "dev-") + TAG=$(echo "${{ steps.meta.outputs.tags }}" | grep "ghcr.io" | grep "dev-" | tr '\n' ' ' | cut -f1 -d ' ') echo "Using tag ${TAG}"; export GANTRY_TEST_CONTAINER_REPO_TAG="${TAG}"; export GANTRY_TEST_ENABLE_TESTS="test_new_image_"; diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index be4420d..747bccf 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -98,13 +98,15 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} provenance: false - # - name: Post push tests - # run: | - # echo "Start running tests" - # export GANTRY_TEST_CONTAINER_REPO_TAG="${{ github.repository }}:${{ steps.git.outputs.image_tag }}" - # export GANTRY_TEST_ENABLE_TESTS="new_image" - # ./tests/run_all_tests.sh "gantry-test" "ghcr.io" "${{ github.repository_owner }}" "${{ github.token }}" - # echo "Done running tests" + - name: Post push tests + run: | + echo "Start running tests"; + TAG=$(echo "${{ steps.meta.outputs.tags }}" | grep "ghcr.io" | tr '\n' ' ' | cut -f1 -d ' ') + echo "Using tag ${TAG}"; + export GANTRY_TEST_CONTAINER_REPO_TAG="${TAG}"; + export GANTRY_TEST_ENABLE_TESTS="test_new_image_"; + ./tests/run_all_tests.sh "${{ github.repository }}-test" "ghcr.io" "${{ github.repository_owner }}" "${{ github.token }}"; + echo "Done running tests"; clean-ghcr-tests: name: Delete old tests container images