Skip to content

Commit

Permalink
feat(ci): use built docker image for tests without the need of upload…
Browse files Browse the repository at this point in the history
…ing to dockerhub
  • Loading branch information
KSDaemon committed Oct 2, 2024
1 parent 779eacd commit 8d48cde
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion .github/workflows/drivers-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -167,7 +170,17 @@ 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-${{ github.sha }}
docker save $IMAGE_TAG | gzip > image.tar.gz
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
Expand Down Expand Up @@ -261,6 +274,15 @@ 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 -c image.tar.gz | docker load
- 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
Expand Down

0 comments on commit 8d48cde

Please sign in to comment.