diff --git a/.github/workflows/r-pytest.yml b/.github/workflows/r-pytest.yml index fa06862602..1e20f5d442 100644 --- a/.github/workflows/r-pytest.yml +++ b/.github/workflows/r-pytest.yml @@ -14,63 +14,38 @@ permissions: contents: read jobs: - cache-img-postgis: - uses: hotosm/gh-workflows/.github/workflows/image_cache.yml@main - with: - image_name: postgis/postgis:14-3.3-alpine - cache_key: img-postgis - - cache-img-odk: - uses: hotosm/gh-workflows/.github/workflows/image_cache.yml@main - with: - image_name: ghcr.io/hotosm/fmtm/odkcentral:v2023.2.1 - cache_key: img-odk - - cache-img-odk-proxy: - uses: hotosm/gh-workflows/.github/workflows/image_cache.yml@main - with: - image_name: ghcr.io/hotosm/fmtm/odkcentral-proxy:latest - cache_key: img-odk-proxy - run-pytest: runs-on: ubuntu-latest environment: name: ${{ inputs.environment || 'test' }} - needs: - - cache-img-postgis - - cache-img-odk - - cache-img-odk-proxy steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Download Postgis Img - uses: actions/download-artifact@v3 - with: - name: ${{ needs.cache-img-postgis.outputs.cache_key }} - path: /tmp/${{ needs.cache-img-postgis.outputs.cache_key }}.tar - # continue-on-error: true - - - name: Download ODK Img + - id: images + name: Download image cache uses: actions/download-artifact@v3 with: - name: ${{ needs.cache-img-odk.outputs.cache_key }} - path: /tmp/${{ needs.cache-img-odk.outputs.cache_key }}.tar - # continue-on-error: true - - - name: Download ODK Proxy Img - uses: actions/download-artifact@v3 - with: - name: ${{ needs.cache-img-odk-proxy.outputs.cache_key }} - path: /tmp/${{ needs.cache-img-odk-proxy.outputs.cache_key }}.tar - # continue-on-error: true + name: image-cache + path: /tmp/images + continue-on-error: true - name: Load Cached Imgs + if: images.outputs.download_path == '/tmp/images' run: | - docker image load --input /tmp/${{ needs.cache-img-postgis.outputs.cache_key }}.tar || true - docker image load --input /tmp/${{ needs.cache-img-odk.outputs.cache_key }}.tar || true - docker image load --input /tmp/${{ needs.cache-img-odk-proxy.outputs.cache_key }}.tar || true + for image_tar in /tmp/images/*; do + docker image load --input $image_tar || true + done + + - if: images.outputs.download_path != '/tmp/images' + uses: hotosm/gh-workflows/.github/workflows/image_cache.yml@main + with: + image_names: | + postgis/postgis:14-3.3-alpine + ghcr.io/hotosm/fmtm/odkcentral:v2023.2.1 + ghcr.io/hotosm/fmtm/odkcentral-proxy:latest + cache_key: image-cache - name: Environment to .env env: