From e7652fbae317e95a0bc1e55e88cc371bd3073914 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 17 Jun 2023 00:31:20 -0400 Subject: [PATCH 1/3] tests: split out image building into it's own job to speed up ci Previously, we would build the dokku package and install it in the same step. While the package building was relatively quick, because of our multi-architecture support, we would end up spending a large amount of time waiting for arm/arm64 images to build. This change splits those builds out, allowing unit tests to start much quicker and each platform to be tested in parallel. --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++++++++++++ contrib/release-dokku | 2 +- 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 18cf0a346..314e2f615 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,6 +61,8 @@ jobs: - name: build package run: ./tests/ci/setup.sh build + env: + SKIP_IMAGE_BUILD: true - name: set matrix for build id: set-matrix @@ -75,6 +77,41 @@ jobs: name: build path: build + build-image: + name: build-image.${{ matrix.architecture }} + needs: build + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + architecture: + - linux/amd64 + - linux/arm + - linux/arm64 + + steps: + - uses: actions/checkout@v3 + + - name: download packages + uses: actions/download-artifact@v3 + with: + name: build + path: build + + - name: set up qemu + uses: docker/setup-qemu-action@v2 + + - name: set up docker buildx + id: buildx + uses: docker/setup-buildx-action@v2 + + - name: build docker image + run: | + docker buildx build \ + --platform ${{ matrix.architecture }} \ + --progress plain \ + --tag "dokku/dokku:latest" + unit-tests: name: unit.${{ matrix.index }} needs: build diff --git a/contrib/release-dokku b/contrib/release-dokku index 1cb056297..5cff7f81a 100755 --- a/contrib/release-dokku +++ b/contrib/release-dokku @@ -391,7 +391,7 @@ fn-build-docker-image() { --push \ --tag "dokku/dokku:latest" \ --tag "dokku/dokku:$VERSION" . - else + elif [[ "$SKIP_IMAGE_BUILD" != "true" ]]; then docker buildx build \ --platform linux/arm,linux/arm64,linux/amd64 \ --progress plain \ From 4aebdd7e83ddfb5418645c61c4ed179c8620d8ed Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 17 Jun 2023 00:47:28 -0400 Subject: [PATCH 2/3] fix: correct yaml formatting issues --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 314e2f615..da84991e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -62,7 +62,7 @@ jobs: - name: build package run: ./tests/ci/setup.sh build env: - SKIP_IMAGE_BUILD: true + SKIP_IMAGE_BUILD: true - name: set matrix for build id: set-matrix @@ -104,7 +104,7 @@ jobs: - name: set up docker buildx id: buildx uses: docker/setup-buildx-action@v2 - + - name: build docker image run: | docker buildx build \ From fdf37e1752778ce0ecbe4e28f034c1bc6c64a751 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 17 Jun 2023 01:02:41 -0400 Subject: [PATCH 3/3] fix: add context --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da84991e1..f25ba1bc5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -110,7 +110,8 @@ jobs: docker buildx build \ --platform ${{ matrix.architecture }} \ --progress plain \ - --tag "dokku/dokku:latest" + --tag "dokku/dokku:latest" \ + . unit-tests: name: unit.${{ matrix.index }}