Skip to content

Fix Linux CI

Fix Linux CI #122

Workflow file for this run

name: Linux-Build
on:
pull_request:
push:
paths-ignore:
- '.github/workflows/windows-build.yml'
- '.gitignore'
- 'LICENSE'
- 'README.md'
jobs:
build:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-latest]
arch: [x64]
mode: [debug, releasedbg]
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, 'ci skip')"
env:
OBS_VERSION: '26.0.0'
steps:
- name: Get current date as package key
id: pkg_key
run: echo "::set-output name=key::$(date +'%W')"
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout Kinect SDKs
uses: actions/checkout@v4
continue-on-error: true
with:
repository: SirLynix/kinect-sdks
token: ${{ secrets.KINECT_SDKS_PAT }}
path: ${{ github.workspace }}/kinect-sdks
# Install OBS studio & Kinect for Azure dependencies
- name: Install apt dependencies
run: |
sudo apt-get -qq update
sudo apt-get install -y \
build-essential \
checkinstall \
cmake \
git \
libmbedtls-dev \
libasound2-dev \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libcurl4-openssl-dev \
libfdk-aac-dev \
libfontconfig-dev \
libfreetype6-dev \
libgl1-mesa-dev \
libjack-jackd2-dev \
libjansson-dev \
libluajit-5.1-dev \
libpulse-dev \
libqt5x11extras5-dev \
libspeexdsp-dev \
libswresample-dev \
libswscale-dev \
libudev-dev \
libv4l-dev \
libvlc-dev \
libx11-dev \
libx264-dev \
libxcb-shm0-dev \
libxcb-xinerama0-dev \
libxcomposite-dev \
libxinerama-dev \
pkg-config \
python3-dev \
qtbase5-dev \
libqt5svg5-dev \
swig \
libxcb-randr0-dev \
libxcb-xfixes0-dev \
libx11-xcb-dev \
libxcb1-dev \
libxss-dev \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu \
file \
dpkg-dev \
qemu \
binfmt-support \
qemu-user-static \
pkg-config \
ninja-build \
doxygen \
clang \
python3 \
gcc \
g++ \
git \
git-lfs \
nasm \
cmake \
powershell \
libgl1-mesa-dev \
libsoundio-dev \
libjpeg-dev \
libvulkan-dev \
libx11-dev \
libxcursor-dev \
libxinerama-dev \
libxrandr-dev \
libusb-1.0-0-dev \
libssl-dev \
libudev-dev \
mesa-common-dev \
uuid-dev
# Cache OBS Studio
- name: Retrieve OBS Studio cache
uses: actions/cache@v3
id: obs-cache
with:
path: ${{ github.workspace }}/obs-studio
key: Linux-OBS-Studio-${{ env.OBS_VERSION }}
# Build obs-studio
- name: Clone OBS
if: steps.obs-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
with:
repository: obsproject/obs-studio
path: ${{ github.workspace }}/obs-studio
submodules: 'recursive'
fetch-depth: 0 # for tags
# Checkout OBS to the wanted version
- name: Checkout OBS-Studio release (${{ env.OBS_VERSION }})
if: steps.obs-cache.outputs.cache-hit != 'true'
shell: bash
working-directory: ${{ github.workspace }}/obs-studio
run: |
git checkout ${{ env.OBS_VERSION }}
git submodule update
# Configure and build obs
- name: Build OBS-Studio
if: steps.obs-cache.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/obs-studio
shell: bash
run: |
mkdir ./build64
cd ./build64
cmake -DDISABLE_PLUGINS=YES -DENABLE_SCRIPTING=NO -DUNIX_STRUCTURE=YES ..
make -j4 libobs
# Force xmake to a specific folder (for cache)
- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV
# Install xmake
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: branch@dev
# Prepare environment
- name: Configure build
run:
printf "LibObs = {\n Include = [[${{ github.workspace }}/obs-studio/libobs]],\n Lib64 = [[${{ github.workspace }}/obs-studio/build64/libobs]]\n}\n\nObsPlugins={}" > config.lua
# Update xmake repository (in order to have the file that will be cached)
- name: Update xmake repository
run: xmake repo --update
# Fetch xmake dephash
- name: Retrieve dependencies hash
id: dep_hash
run: echo "::set-output name=hash::$(xmake l utils.ci.packageskey)"
# Cache xmake dependencies
- name: Retrieve cached xmake dependencies
uses: actions/cache@v3
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: Linux-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.pkg_key.outputs.key }}
# Setup compilation mode and install project dependencies
- name: Configure xmake and install dependencies
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --yes --verbose
env:
KINECTSDKAZUREBT_DIR: ${{ github.workspace }}/kinect-sdks/k4abt
# Build the plugin
- name: Build obs-kinect
run: xmake --verbose
env:
KINECTSDKAZUREBT_DIR: ${{ github.workspace }}/kinect-sdks/k4abt
# Install the result files
- name: Install obs-kinect
run: xmake package -vo package
env:
KINECTSDKAZUREBT_DIR: ${{ github.workspace }}/kinect-sdks/k4abt
# Upload artifacts
- uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.mode }}
path: package