From b1070d494113f5832e354523abd01486b33e2265 Mon Sep 17 00:00:00 2001 From: Konstantin Burkalev Date: Wed, 2 Oct 2024 16:51:56 +0300 Subject: [PATCH] =?UTF-8?q?feat(ci):=20use=20built=20docker=20image=20for?= =?UTF-8?q?=C2=A0tests=20without=20the=C2=A0need=20of=20uploading=20to?= =?UTF-8?q?=C2=A0dockerhub?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/drivers-tests.yml | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/.github/workflows/drivers-tests.yml b/.github/workflows/drivers-tests.yml index 03dbf526127cb..18c6bc0dbe7b2 100644 --- a/.github/workflows/drivers-tests.yml +++ b/.github/workflows/drivers-tests.yml @@ -144,6 +144,8 @@ jobs: if: (needs['latest-tag-sha'].outputs.sha != github.sha) runs-on: ubuntu-20.04 timeout-minutes: 30 + env: + DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} steps: - name: Check out the repo uses: actions/checkout@v4 @@ -154,6 +156,7 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + if: (env.DOCKERHUB_USERNAME != '') - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Download native build @@ -167,7 +170,18 @@ jobs: context: . file: ./packages/cubejs-docker/testing-drivers.Dockerfile tags: cubejs/cube:testing-drivers - push: true + push: ${{ (env.DOCKERHUB_USERNAME != '') }} + - name: Save Docker image as artifact + run: | + IMAGE_TAG=cubejs/cube:testing-drivers + docker save -o image.tar $IMAGE_TAG + gzip image.tar + continue-on-error: true + - name: Upload Docker image artifact + uses: actions/upload-artifact@v4 + with: + name: docker-image + path: image.tar.gz tests: runs-on: ubuntu-20.04 @@ -261,6 +275,16 @@ jobs: cd packages/cubejs-testing-drivers yarn tsc + - name: Download Docker image artifact + uses: actions/download-artifact@v4 + with: + name: docker-image + + - name: Load Docker image into Docker Daemon + run: | + gunzip image.tar.gz + docker load -i image.tar + - name: Run tests uses: nick-fields/retry@v3 # It's enough to test for any one secret because they are set all at once or not set all