obs-StreamFX/.github/workflows/validate.yml

76 lines
1.9 KiB
YAML
Raw Normal View History

name: Validation
on:
pull_request:
branches:
- '*'
push:
tags:
- '*'
env:
CACHE_VERSION: 1
jobs:
clang-format:
name: "clang-format"
runs-on: ubuntu-20.04
env:
2021-10-22 01:45:29 +00:00
CC: clang
CXX: clang++
CMAKE_GENERATOR: "Ninja"
steps:
- name: "Clone"
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- name: "Prerequisites: Apt-Get"
shell: bash
run: |
sudo apt-get -qq update
sudo apt-get purge libjpeg9-dev:amd64 libjpeg8-dev:amd64 libjpeg-turbo8-dev:amd64
sudo apt-get install \
build-essential \
checkinstall \
pkg-config \
cmake \
ninja-build \
git \
${{ matrix.packages }} \
qt5-default libqwt-qt5-dev libqt5svg5-dev \
libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libswresample-dev libswscale-dev \
libcurl4-openssl-dev
2021-10-22 01:45:29 +00:00
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
- name: "Dependencies: Cache"
if: ${{ github.event_name != 'pull_request' }}
uses: actions/cache@v2
with:
path: |
build/temp/autodeps
key: autodeps-${{ matrix.id }}-${{ env.CACHE_VERSION }}
- name: "StreamFX: Configure"
shell: bash
run: |
cmake -H. -B"build/temp" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX="build/distrib" \
-DCMAKE_PACKAGE_NAME="streamfx-${{ matrix.id }}" \
-DCMAKE_PACKAGE_PREFIX="build/package" \
-DENABLE_CLANG=TRUE
- name: "StreamFX: Format"
shell: bash
run: |
cmake --build "build/temp" --config RelWithDebInfo --target StreamFX_CLANG-FORMAT
- name: "Validate Formatting"
shell: bash
run: |
git --no-pager diff --patch --minimal HEAD --
git update-index --refresh
git diff-index --quiet HEAD --