Skip to content

Commit

Permalink
ci: split unstable build and test workflows (jitsi#1601)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
saghul committed Sep 12, 2023
1 parent 603d461 commit b3abfc0
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 134 deletions.
84 changes: 84 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
134 changes: 0 additions & 134 deletions .github/workflows/unstable.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Unstable Build

on:
pull_request:
schedule:
- cron: "0 6 * * *"
workflow_dispatch:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit b3abfc0

Please sign in to comment.