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.
This commit is contained in:
Saúl Ibarra Corretgé
2023-09-12 10:29:30 +02:00
committed by GitHub
parent 603d461179
commit b3abfc0b0b
2 changed files with 84 additions and 134 deletions

84
.github/workflows/ci.yml vendored Normal file
View File

@@ -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

View File

@@ -1,7 +1,6 @@
name: Unstable Build name: Unstable Build
on: on:
pull_request:
schedule: schedule:
- cron: "0 6 * * *" - cron: "0 6 * * *"
workflow_dispatch: workflow_dispatch:
@@ -70,13 +69,11 @@ jobs:
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' }}
with: with:
push: true push: true
context: ./base context: ./base
@@ -88,19 +85,6 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max 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: base-java:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -116,13 +100,11 @@ jobs:
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' }}
with: with:
push: true push: true
context: ./base-java context: ./base-java
@@ -135,20 +117,6 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max 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: jibri:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -164,13 +132,11 @@ jobs:
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' }}
with: with:
push: true push: true
context: ./jibri context: ./jibri
@@ -184,21 +150,6 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max 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: jicofo:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -214,13 +165,11 @@ jobs:
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' }}
with: with:
push: true push: true
context: ./jicofo context: ./jicofo
@@ -234,21 +183,6 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max 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: jigasi:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -264,13 +198,11 @@ jobs:
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' }}
with: with:
push: true push: true
context: ./jigasi context: ./jigasi
@@ -284,21 +216,6 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max 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: jvb:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -314,13 +231,11 @@ jobs:
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' }}
with: with:
push: true push: true
context: ./jvb context: ./jvb
@@ -334,21 +249,6 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max 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: prosody:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -364,13 +264,11 @@ jobs:
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' }}
with: with:
push: true push: true
context: ./prosody context: ./prosody
@@ -384,21 +282,6 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max 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: web:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -414,13 +297,11 @@ jobs:
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v1
- name: Login to DockerHub - name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v1
if: ${{ github.event_name != 'pull_request' }}
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push - name: Build and push
uses: docker/build-push-action@v2 uses: docker/build-push-action@v2
if: ${{ github.event_name != 'pull_request' }}
with: with:
push: true push: true
context: ./web context: ./web
@@ -434,18 +315,3 @@ jobs:
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max 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