Skip to content

fix docker

fix docker #532

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
jobs:
docker:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
ubuntu: ["jammy", "noble"]
permissions:
contents: read
packages: write
steps:
- name: Free space
run: |
# Workaround to provide additional free space.
# https://github.com/actions/runner-images/issues/2840#issuecomment-790492173
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost "$AGENT_TOOLSDIRECTORY"
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
flavor: prefix=${{ matrix.ubuntu }}-
- name: Setup buildx
uses: docker/setup-buildx-action@v3
- name: Log into registry ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Source versions
run: |
source builders/versions
echo "QT_VER=${QT_VER}" >> $GITHUB_ENV
echo "QT_INSTALLER_VER=${QT_INSTALLER_VER}" >> $GITHUB_ENV
- name: Build mediafx image
uses: docker/build-push-action@v5
with:
context: builders/
file: builders/Linux/Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
target: mediafx
secrets: |
"qtaccount=${{ secrets.QTACCOUNT }}"
build-args: |
"QT_VER=${{ env.QT_VER }}"
"QT_INSTALLER_VER=${{ env.QT_INSTALLER_VER }}"
"UBUNTU=${{ matrix.ubuntu }}"
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
linux:
runs-on: ubuntu-22.04
needs: docker
strategy:
fail-fast: false
matrix:
ubuntu: ["jammy", "noble"]
include:
- ubuntu: "noble"
test: "builders/Linux/docker-run.sh /mediafx/builders/mediafx-test.sh --verbose"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Build/test mediaFX
run: |
export TARGET=opengl
export UBUNTU=${{ matrix.ubuntu }}
builders/Linux/docker-run.sh
${{ matrix.test }}
- name: Build/test mediaFX vulkan
if: matrix.ubuntu == 'noble'
run: |
export TARGET=vulkan
export UBUNTU=${{ matrix.ubuntu }}
builders/Linux/docker-run.sh
${{ matrix.test }}
- name: Upload Failed Artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed-output-linux-${{ matrix.ubuntu }}
path: build/Linux/output
macos:
runs-on: macos-14
strategy:
fail-fast: false
matrix:
ffmpeg: ["ffmpeg@4", "ffmpeg@6"]
include:
- ffmpeg: "ffmpeg@6"
test: "builders/mediafx-test.sh --verbose"
env:
XCODE_VER: "15.3"
steps:
- name: Brew ffmpeg
run: |
brew install bash ${{ matrix.ffmpeg }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Xcode
run: |
sudo xcode-select -s "/Applications/Xcode_${XCODE_VER}.app"
- name: Restore cached installation
uses: actions/cache/restore@v4
id: restore-cache
with:
path: build/Darwin/installed
key: ${{ runner.os }}-${{ hashFiles('builders/versions') }}-${{ hashFiles('builders/Darwin/install-qt6.sh') }}-${{ hashFiles('builders/aqtinstall-requirements.txt') }}-${{ env.XCODE_VER }}
- name: Build installation
if: steps.restore-cache.outputs.cache-hit != 'true'
run: |
mkdir -p ~/Library/Application\ Support/Qt
echo "${{ secrets.QTACCOUNT }}" > ~/Library/Application\ Support/Qt/qtaccount.ini
builders/Darwin/install-qt6.sh
- name: Save cached installation
uses: actions/cache/save@v4
if: steps.restore-cache.outputs.cache-hit != 'true'
with:
path: build/Darwin/installed
key: ${{ steps.restore-cache.outputs.cache-primary-key }}
- name: Build/test mediaFX
run: |
export PATH="$(brew --prefix ${{ matrix.ffmpeg }})/bin:$PATH"
export PKG_CONFIG_PATH="$(brew --prefix ${{ matrix.ffmpeg }})/lib/pkgconfig"
builders/mediafx-build.sh
${{ matrix.test }}
- name: Upload Failed Artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed-output-darwin-${{ matrix.ffmpeg }}
path: build/Darwin/output
lint:
runs-on: ubuntu-22.04
needs: docker
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: clang-format
uses: jidicula/[email protected]
with:
clang-format-version: '15'
- name: clang-tidy/clazy
run: builders/Linux/docker-run.sh /mediafx/builders/Linux/lint.sh
- name: qmlformat
run: builders/Linux/docker-run.sh bash -c 'cd /mediafx && qmlformat -i $(git ls-files "**/*.qml") && git diff --exit-code'
- name: qmllint
if: ${{ false }}
run: builders/Linux/docker-run.sh bash -c 'cd /mediafx && qmllint --qmltypes build/Linux/Release/src/mediafx/qmldir $(git ls-files "**/*.qml")'