From 814b5e092e21d9d53f4040118016610eaef240de Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Sun, 22 Oct 2023 05:37:40 +0100 Subject: [PATCH] ci(pytest): remove redundant var build_test_img --- .github/workflows/pr_test_backend.yml | 1 - .github/workflows/r-pytest.yml | 14 ++++---------- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/pr_test_backend.yml b/.github/workflows/pr_test_backend.yml index c4ffc2b631..45e9d3370e 100644 --- a/.github/workflows/pr_test_backend.yml +++ b/.github/workflows/pr_test_backend.yml @@ -17,7 +17,6 @@ jobs: uses: ./.github/workflows/r-pytest.yml with: docker_compose_service: api - build_test_img: true # cache_imgs: | # "docker.io/postgis/postgis:${{ vars.POSTGIS_TAG }}" # "docker.io/minio/minio:${{ vars.MINIO_TAG }}" diff --git a/.github/workflows/r-pytest.yml b/.github/workflows/r-pytest.yml index ac3738b72f..532ede7545 100644 --- a/.github/workflows/r-pytest.yml +++ b/.github/workflows/r-pytest.yml @@ -7,12 +7,6 @@ on: description: "Optional image tag override." required: false type: string - default: ci-development - build_test_img: - description: "Build an image prior to test, e.g. if new deps added." - required: false - type: boolean - default: false cache_imgs: description: "Space separated list of images to cache on each run." required: false @@ -50,7 +44,7 @@ jobs: backend-test-build: uses: hotosm/gh-workflows/.github/workflows/image_build.yml@main needs: [check-img-cache] - if: ${{ inputs.build_test_img && needs.check-img-cache.outputs.cache-hit != 'true' }} + if: ${{ inputs.image_tag == "" && needs.check-img-cache.outputs.cache-hit != 'true' }} with: context: src/backend build_target: ci @@ -66,7 +60,7 @@ jobs: run-pytest: runs-on: ubuntu-latest needs: [backend-test-build] - # Ensure it runs, even if build_test_img=false + # Ensure it runs, even if backend-test-build does not run if: always() environment: name: ${{ inputs.environment }} @@ -110,8 +104,8 @@ jobs: pull_and_package_image "$image" done - # Cache backend build - image_tag=${{ needs.backend-test-build.outputs.image_tag || inputs.image_tag }} + # Cache backend build (fallback to ci-development tag) + image_tag=${{ needs.backend-test-build.outputs.image_tag || ci-development }} image="ghcr.io/${{ github.repository }}/backend:${image_tag}" pull_and_package_image "$image" echo "API_TAG_OVERRIDE=${image_tag}" >> $GITHUB_ENV