From b3abfc0b0b0edb5f0f85598443d0a7c4755dbb8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Tue, 12 Sep 2023 10:29:30 +0200 Subject: [PATCH] ci: split unstable build and test workflows (#1601) * ci: split unstable build and test workflows In order to make multi-arch builds the buildx action will use the docker-container driver, which does not support loading images, and thus the jvb image won't be built based on the "base-java" image, in turn based on the "base" image. That works only when pushing. If we setup buildx to use the "docker" driver it will just build for the current architecture, but it will properly load images and the base images will be used correctly. One downside is that jobs cannot be run in parallel, but it seems to be Fast Enough (R) for now. --- .github/workflows/ci.yml | 84 +++++++++++++++++++++ .github/workflows/unstable.yml | 134 --------------------------------- 2 files changed, 84 insertions(+), 134 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c6f7318 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,84 @@ +name: CI Test Build + +on: + pull_request: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v3 + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v2 + with: + driver: docker + + - name: Build base + uses: docker/build-push-action@v2 + with: + context: ./base + load: true + tags: | + jitsi/base:latest + build-args: | + JITSI_RELEASE=unstable + + - name: Build base-java + uses: docker/build-push-action@v2 + with: + context: ./base-java + load: true + tags: | + jitsi/base-java:latest + + - name: Build jibri + uses: docker/build-push-action@v2 + with: + context: ./jibri + load: true + tags: | + jitsi/jibri:latest + + - name: Build jicofo + uses: docker/build-push-action@v2 + with: + context: ./jicofo + load: true + tags: | + jitsi/jicofo:latest + + - name: Build jigasi + uses: docker/build-push-action@v2 + with: + context: ./jigasi + load: true + tags: | + jitsi/jigasi:latest + + - name: Build jvb + uses: docker/build-push-action@v2 + with: + context: ./jvb + load: true + tags: | + jitsi/jvb:latest + + - name: Build prosody + uses: docker/build-push-action@v2 + with: + context: ./prosody + load: true + tags: | + jitsi/prosody:latest + + - name: Build web + uses: docker/build-push-action@v2 + with: + context: ./web + load: true + tags: | + jitsi/web:latest diff --git a/.github/workflows/unstable.yml b/.github/workflows/unstable.yml index db54d1d..3dbad53 100644 --- a/.github/workflows/unstable.yml +++ b/.github/workflows/unstable.yml @@ -1,7 +1,6 @@ name: Unstable Build on: - pull_request: schedule: - cron: "0 6 * * *" workflow_dispatch: @@ -70,13 +69,11 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 - if: ${{ github.event_name != 'pull_request' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 - if: ${{ github.event_name != 'pull_request' }} with: push: true context: ./base @@ -88,19 +85,6 @@ jobs: platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max - - name: Dryrun - uses: docker/build-push-action@v2 - if: ${{ github.event_name == 'pull_request' }} - with: - context: ./base - tags: | - jitsi/base:${{ needs.version.outputs.base }} - jitsi/base:${{ needs.version.outputs.date }} - build-args: | - JITSI_RELEASE=unstable - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max base-java: runs-on: ubuntu-latest @@ -116,13 +100,11 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 - if: ${{ github.event_name != 'pull_request' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 - if: ${{ github.event_name != 'pull_request' }} with: push: true context: ./base-java @@ -135,20 +117,6 @@ jobs: platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max - - name: Dryrun - uses: docker/build-push-action@v2 - if: ${{ github.event_name == 'pull_request' }} - with: - context: ./base-java - tags: | - jitsi/base-java:${{ needs.version.outputs.base }} - jitsi/base-java:${{ needs.version.outputs.date }} - build-args: | - JITSI_REPO=jitsi - BASE_TAG=${{ needs.version.outputs.base }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max jibri: runs-on: ubuntu-latest @@ -164,13 +132,11 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 - if: ${{ github.event_name != 'pull_request' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 - if: ${{ github.event_name != 'pull_request' }} with: push: true context: ./jibri @@ -184,21 +150,6 @@ jobs: platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max - - name: Dryrun - uses: docker/build-push-action@v2 - if: ${{ github.event_name == 'pull_request' }} - with: - context: ./jibri - tags: | - jitsi/jibri:${{ needs.version.outputs.base }} - jitsi/jibri:${{ needs.version.outputs.date }} - jitsi/jibri:${{ needs.version.outputs.jibri_version }} - build-args: | - JITSI_REPO=jitsi - BASE_TAG=${{ needs.version.outputs.base }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max jicofo: runs-on: ubuntu-latest @@ -214,13 +165,11 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 - if: ${{ github.event_name != 'pull_request' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 - if: ${{ github.event_name != 'pull_request' }} with: push: true context: ./jicofo @@ -234,21 +183,6 @@ jobs: platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max - - name: Dryrun - uses: docker/build-push-action@v2 - if: ${{ github.event_name == 'pull_request' }} - with: - context: ./jicofo - tags: | - jitsi/jicofo:${{ needs.version.outputs.base }} - jitsi/jicofo:${{ needs.version.outputs.date }} - jitsi/jicofo:${{ needs.version.outputs.jicofo_version }} - build-args: | - JITSI_REPO=jitsi - BASE_TAG=${{ needs.version.outputs.base }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max jigasi: runs-on: ubuntu-latest @@ -264,13 +198,11 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 - if: ${{ github.event_name != 'pull_request' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 - if: ${{ github.event_name != 'pull_request' }} with: push: true context: ./jigasi @@ -284,21 +216,6 @@ jobs: platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max - - name: Dryrun - uses: docker/build-push-action@v2 - if: ${{ github.event_name == 'pull_request' }} - with: - context: ./jigasi - tags: | - jitsi/jigasi:${{ needs.version.outputs.base }} - jitsi/jigasi:${{ needs.version.outputs.date }} - jitsi/jigasi:${{ needs.version.outputs.jigasi_version }} - build-args: | - JITSI_REPO=jitsi - BASE_TAG=${{ needs.version.outputs.base }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max jvb: runs-on: ubuntu-latest @@ -314,13 +231,11 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 - if: ${{ github.event_name != 'pull_request' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 - if: ${{ github.event_name != 'pull_request' }} with: push: true context: ./jvb @@ -334,21 +249,6 @@ jobs: platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max - - name: Dryrun - uses: docker/build-push-action@v2 - if: ${{ github.event_name == 'pull_request' }} - with: - context: ./jvb - tags: | - jitsi/jvb:${{ needs.version.outputs.base }} - jitsi/jvb:${{ needs.version.outputs.date }} - jitsi/jvb:${{ needs.version.outputs.jvb_version }} - build-args: | - JITSI_REPO=jitsi - BASE_TAG=${{ needs.version.outputs.base }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max prosody: runs-on: ubuntu-latest @@ -364,13 +264,11 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 - if: ${{ github.event_name != 'pull_request' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 - if: ${{ github.event_name != 'pull_request' }} with: push: true context: ./prosody @@ -384,21 +282,6 @@ jobs: platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max - - name: Dryrun - uses: docker/build-push-action@v2 - if: ${{ github.event_name == 'pull_request' }} - with: - context: ./prosody - tags: | - jitsi/prosody:${{ needs.version.outputs.base }} - jitsi/prosody:${{ needs.version.outputs.date }} - jitsi/prosody:${{ needs.version.outputs.prosody_version }} - build-args: | - JITSI_REPO=jitsi - BASE_TAG=${{ needs.version.outputs.base }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max web: runs-on: ubuntu-latest @@ -414,13 +297,11 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Login to DockerHub uses: docker/login-action@v1 - if: ${{ github.event_name != 'pull_request' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push uses: docker/build-push-action@v2 - if: ${{ github.event_name != 'pull_request' }} with: push: true context: ./web @@ -434,18 +315,3 @@ jobs: platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max - - name: Dryrun - uses: docker/build-push-action@v2 - if: ${{ github.event_name == 'pull_request' }} - with: - context: ./web - tags: | - jitsi/web:${{ needs.version.outputs.base }} - jitsi/web:${{ needs.version.outputs.date }} - jitsi/web:${{ needs.version.outputs.web_version }} - build-args: | - JITSI_REPO=jitsi - BASE_TAG=${{ needs.version.outputs.base }} - platforms: linux/amd64,linux/arm64 - cache-from: type=gha - cache-to: type=gha,mode=max