diff --git a/.github/workflows/plugins.yml b/.github/workflows/plugins.yml index 5e0b991..449a117 100644 --- a/.github/workflows/plugins.yml +++ b/.github/workflows/plugins.yml @@ -8,6 +8,30 @@ on: pull_request: jobs: + build: + name: Build docker image once and share it to E2E jobs + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build and push + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + tags: ghcr.io/acouvreur/sablier:local + outputs: type=docker,dest=/tmp/sablier.tar + + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: sablier-image-tar + path: /tmp/sablier.tar + traefik: name: Build Sablier for Traefik middleware runs-on: ubuntu-latest @@ -29,6 +53,7 @@ jobs: traefik_e2e: name: Run Sablier E2E tests for Traefik middleware runs-on: ubuntu-latest + needs: build strategy: fail-fast: false matrix: @@ -42,22 +67,17 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + + - name: Download artifact + uses: actions/download-artifact@v2 with: - version: latest - buildkitd-flags: --debug - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - load: true - context: . - tags: ghcr.io/acouvreur/sablier:local + name: sablier-image-tar + path: /tmp + + - name: Load Docker image + run: docker load --input /tmp/sablier.tar - name: Test ${{ matrix.provider }} run: cd plugins/traefik/e2e && bash ./${{ matrix.provider }}.sh \ No newline at end of file