chore: user lookup-only restore in Docker Cache step #1178
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tests | ||
|
Check failure on line 1 in .github/workflows/test.yaml
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| concurrency: | ||
| group: tests-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| env: | ||
| IMG2VEC: cr.weaviate.io/semitechnologies/img2vec-pytorch:resnet50 | ||
| MINIO: minio/minio | ||
| MODEL2VEC: cr.weaviate.io/semitechnologies/model2vec-inference:minishlab-potion-base-4M | ||
| DOCKER_IMAGES_TAR: docker-images.tar | ||
| jobs: | ||
| docker-cache: | ||
| name: Cache shared Docker images | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| DOCKER_CACHE_KEY: docker-images-${{ env.IMG2VEC }}-${{ env.MINIO }}-${{ env.MODEL2VEC }} | ||
| steps: | ||
| - name: Login to Docker Hub | ||
| if: ${{ !github.event.pull_request.head.repo.fork }} | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| username: ${{ secrets.DOCKER_USERNAME }} | ||
| password: ${{ secrets.DOCKER_PASSWORD }} | ||
| - id: cache-check | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: ${{ env.DOCKER_IMAGES_TAR }} | ||
| key: ${{ env.DOCKER_CACHE_KEY }} | ||
| lookup-only: true # Only check if cache exists, don't download | ||
| - name: Pull images | ||
| if: steps.cache-check.outputs.cache-hit != 'true' | ||
| run: | | ||
| docker pull $IMG2VEC | ||
| docker pull $MINIO | ||
| # docker pull $MODEL2VEC | ||
| docker save $IMG2VEC $MINIO -o $DOCKER_IMAGES_TAR | ||
| - name: Cache images | ||
| if: steps.cache-check.outputs.cache-hit != 'true' | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: ${{ env.DOCKER_IMAGES_TAR }} | ||
| key: ${{ env.DOCKER_CACHE_KEY }} | ||
| maven-cache: | ||
| name: Cache Maven dependencies | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-java@v4 | ||
| with: | ||
| distribution: 'zulu' | ||
| java-version: '17' | ||
| cache: 'maven' | ||
| - run: mvn dependency:go-offline | ||
| test: | ||
| name: Test | ||
| runs-on: ubuntu-latest | ||
| needs: [ docker-cache, maven-cache] | ||
| env: | ||
| DOCKER_CACHE_KEY: docker-images-${{ env.IMG2VEC }}-${{ env.MINIO }}-${{ env.MODEL2VEC }} | ||
| strategy: | ||
| matrix: | ||
| WEAVIATE_VERSION: ["1.32.0", "1.33.0"] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/cache/restore@v4 | ||
| with: | ||
| path: ${{ env.DOCKER_IMAGES_TAR }} | ||
| key: ${{ env.DOCKER_CACHE_KEY }} | ||
| - name: Load Docker images | ||
| run: | | ||
| if [ -f $DOCKER_IMAGES_TAR ]; then | ||
| docker load -i $DOCKER_IMAGES_TAR | ||
| fi | ||
| - uses: actions/setup-java@v4 | ||
| name: Setup JDK | ||
| with: | ||
| distribution: 'zulu' | ||
| java-version: '17' | ||
| cache: 'maven' | ||
| - name: Run Tests (v${{ matrix.WEAVIATE_VERSION }}) | ||
| env: | ||
| OKTA_DUMMY_CI_PW: ${{ secrets.OKTA_DUMMY_CI_PW }} | ||
| WCS_DUMMY_CI_PW: ${{ secrets.WCS_DUMMY_CI_PW }} | ||
| OKTA_CLIENT_SECRET: ${{ secrets.OKTA_CLIENT_SECRET }} | ||
| AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} | ||
| OPENAI_APIKEY: ${{ secrets.OPENAI_APIKEY }} | ||
| WEAVIATE_VERSION: ${{ matrix.WEAVIATE_VERSION }} | ||
| run: mvn verify | ||