Skip to content

chore: Make local development a bit easier against toxcore. #515

chore: Make local development a bit easier against toxcore.

chore: Make local development a bit easier against toxcore. #515

Workflow file for this run

---
name: docker
# Run on push and once a week to keep the images from bitrotting and to
# identify issues while no commits are being pushed.
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "52 2 * * 0"
# Cancel old PR builds when pushing new commits.
concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
fail-fast: false
matrix:
image:
- alpine-s390x
- bazel
- compcert
- doxygen
- flutter-web
- frama-c
- freebsd
- haskell
- pkgsrc
include:
- image: bazel
has_base: true
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Build base image
if: ${{ matrix.has_base }}
run: |
cd ${{ matrix.image }} && ./build.sh
- name: Build and push (with base image)
if: ${{ matrix.has_base }}
uses: docker/build-push-action@v6
with:
context: "${{ matrix.image }}"
build-contexts: "base=oci-layout://${{ matrix.image }}/layers:base"
tags: toxchat/${{ matrix.image }}:latest
cache-from: type=registry,ref=toxchat/${{ matrix.image }}:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
- name: Build and push
if: ${{ !matrix.has_base }}
uses: docker/build-push-action@v6
with:
context: "${{ matrix.image }}"
tags: toxchat/${{ matrix.image }}:latest
cache-from: type=registry,ref=toxchat/${{ matrix.image }}:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
buildfarm:
strategy:
matrix:
image: [server, worker]
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: "{{defaultContext}}:buildfarm"
file: ${{ matrix.image }}.Dockerfile
tags: toxchat/buildfarm-${{ matrix.image }}:latest
cache-from: type=registry,ref=toxchat/buildfarm-${{ matrix.image }}:latest
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
qtox-host-qt:
strategy:
fail-fast: true
matrix:
version: [6.2.4, 6.8.1]
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:qtox"
file: "docker/Dockerfile.host-qt"
build-args: |
QT_VERSION=${{ matrix.version }}
tags: toxchat/qtox:host-qt_${{ matrix.version }}
cache-from: type=registry,ref=toxchat/qtox:host-qt_${{ matrix.version }}
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
qtox:
# Only windows needs it, but this dependency doesn't harm much, as host-qt
# doesn't get changed often.
needs: [qtox-host-qt]
strategy:
fail-fast: false
matrix:
image:
- alpine
- alpine-appimage
- alpine-static
- debian
- fedora
- flatpak-builder
- ubuntu-lts
- windows-builder.i686
- windows-builder.x86_64
include:
- image: windows-builder.i686
file: windows-builder
args: |
ARCH=i686
WINEARCH=win32
- image: windows-builder.x86_64
file: windows-builder
args: |
ARCH=x86_64
WINEARCH=win64
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:qtox"
file: "docker/Dockerfile.${{ matrix.file || matrix.image }}"
build-args: ${{ matrix.args }}
tags: toxchat/qtox:${{ matrix.image }}
cache-from: type=registry,ref=toxchat/qtox:${{ matrix.image }}
cache-to: type=inline
push: ${{ github.event_name == 'push' }}
qtox-android:
needs: [qtox-host-qt]
strategy:
fail-fast: true
matrix:
arch: [armeabi-v7a, arm64-v8a]
build_type: [debug, release]
version: [6.2.4, 6.8.1]
include:
- version: 6.2.4
ndk_version: 21.3.6528147
android_api: 24
- version: 6.8.1
ndk_version: 26.1.10909125
android_api: 26
- arch: armeabi-v7a
abi_args: |
ANDROID_ABI=armeabi-v7a
ANDROID_FFMPEG_ABI=armv7a
ANDROID_OPENSSL_ABI=arm
ANDROID_OPENSSL_ASM=-no-asm
ANDROID_TRIPLE=armv7a-linux-androideabi
ANDROID_VPX_ABI=armv7-android-gcc
- arch: arm64-v8a
abi_args: |
ANDROID_ABI=arm64-v8a
ANDROID_FFMPEG_ABI=arm64
ANDROID_OPENSSL_ABI=arm64
ANDROID_OPENSSL_ASM=
ANDROID_TRIPLE=aarch64-linux-android
ANDROID_VPX_ABI=arm64-android-gcc
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
if: ${{ github.event_name == 'push' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: Build and push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:qtox"
file: "docker/Dockerfile.android-builder"
build-args: |
${{ matrix.abi_args }}
ANDROID_API=${{ matrix.android_api }}
NDK_VERSION=${{ matrix.ndk_version }}
QT_BUILD_TYPE=${{ matrix.build_type }}
QT_VERSION=${{ matrix.version }}
tags: toxchat/qtox:android-builder.${{ matrix.arch }}.${{ matrix.build_type }}_${{ matrix.version }}
cache-from: type=registry,ref=toxchat/qtox:android-builder.${{ matrix.arch }}.${{ matrix.build_type }}_${{ matrix.version }}
cache-to: type=inline
push: ${{ github.event_name == 'push' }}