Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into controllerengine_re…
Browse files Browse the repository at this point in the history
…factoring
  • Loading branch information
Be-ing committed Nov 30, 2020
2 parents b8e2430 + f972563 commit 20fbcb0
Show file tree
Hide file tree
Showing 887 changed files with 28,465 additions and 7,667 deletions.
277 changes: 277 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,277 @@
name: Build

on:
push:
pull_request:

jobs:
build:
strategy:
matrix:
include:
- name: Ubuntu 18.04 (gcc)
os: ubuntu-18.04
cmake_args: >-
-DFAAD=ON
-DKEYFINDER=ON
-DLOCALECOMPARE=ON
-DMAD=ON
-DMODPLUG=ON
-DWAVPACK=ON
cmake_generator: Unix Makefiles
ctest_args:
compiler_cache: ccache
compiler_cache_path: ~/.ccache
cpack_generator: DEB
buildenv_basepath: /home/runner/buildenv
buildenv_script: tools/ubuntu_buildenv.sh
artifacts_name: Ubuntu 18.04 DEB
artifacts_path: cmake_build/*.deb
qt_qpa_platform: offscreen
- name: Ubuntu 20.04 (gcc)
os: ubuntu-20.04
cmake_args: >-
-DFFMPEG=ON
-DKEYFINDER=ON
-DLOCALECOMPARE=ON
-DMAD=ON
-DMODPLUG=ON
-DWAVPACK=ON
cmake_generator: Unix Makefiles
ctest_args:
compiler_cache: ccache
compiler_cache_path: ~/.ccache
cpack_generator: DEB
buildenv_basepath: /home/runner/buildenv
buildenv_script: tools/ubuntu_buildenv.sh
artifacts_name: Ubuntu 20.04 DEB
artifacts_path: cmake_build/*.deb
qt_qpa_platform: offscreen
- name: macOS 10.15
os: macos-10.15
cmake_args: >-
-DCOREAUDIO=ON
-DHSS1394=ON
-DMACOS_BUNDLE=ON
cmake_generator: Unix Makefiles
# TODO: Fix this broken test on macOS
ctest_args: --exclude-regex DirectoryDAOTest.relocateDirectory
cpack_generator: DragNDrop
compiler_cache: ccache
compiler_cache_path: /Users/runner/Library/Caches/ccache
buildenv_basepath: /Users/runner/buildenv
buildenv_script: tools/macos_buildenv.sh
artifacts_name: macOS DMG
artifacts_path: cmake_build/*.dmg
qt_qpa_platform: offscreen
- name: Windows 2019 (MSVC)
os: windows-2019
cmake_args: >-
-DHSS1394=ON
-DKEYFINDER=OFF
-DLOCALECOMPARE=ON
-DMAD=ON
-DMEDIAFOUNDATION=ON
-DSTATIC_DEPS=ON
cc: cl
cxx: cl
cmake_generator: Ninja
# TODO: Fix these broken tests on Windows
ctest_args: --exclude-regex '^AutoDJProcessorTest.*$'
cpack_generator: WIX
compiler_cache: clcache
compiler_cache_path: ${{ github.workspace }}\clcache
buildenv_basepath: C:\buildenv
buildenv_script: tools/windows_buildenv.bat
artifacts_name: Windows Installer
artifacts_path: cmake_build/*.msi
qt_qpa_platform: windows

env:
# macOS codesigning
APPLE_CODESIGN_IDENTITY: 2C2B5D3EDCE82BA55E22E9A67F16F8D03E390870
MACOS_CODESIGN_OPENSSL_PASSWORD: ${{ secrets.MACOS_CODESIGN_OPENSSL_PASSWORD }}
MACOS_CODESIGN_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CODESIGN_CERTIFICATE_PASSWORD }}

runs-on: ${{ matrix.os }}
name: ${{ matrix.name }}
steps:
- name: "Check out repository"
uses: actions/checkout@v2

- name: "Set up cmake"
uses: jwlawson/actions-setup-cmake@v1.4
with:
# This should always match the mininum required version in
# our CMakeLists.txt
cmake-version: '3.13.x'

- name: "[Windows] Install additional build tools"
if: runner.os == 'Windows'
run: python -m pip install ninja git+https://github.com/frerich/clcache.git

- name: "[Windows] Set up MSVC Developer Command Prompt"
if: runner.os == 'Windows'
uses: seanmiddleditch/gha-setup-vsdevenv@v3

- name: "[macOS/Windows] Get build environment name"
if: runner.os != 'Linux'
id: buildenv_name
run: ${{ matrix.buildenv_script }} name

- name: "[macOS/Windows] Set up build environment cache"
if: runner.os != 'Linux'
uses: actions/cache@v2
with:
path: ${{ matrix.buildenv_basepath }}
key: ${{ runner.os }}-buildenv-${{ env.BUILDENV_NAME }}

- name: "[macOS] Import Apple code signing identity"
id: apple_codesign
if: runner.os == 'macOS' && env.MACOS_CODESIGN_OPENSSL_PASSWORD != null && env.MACOS_CODESIGN_CERTIFICATE_PASSWORD != null
run: |
# Decrypt the certificate
openssl enc -aes-256-cbc -d -md sha512 \
-k "${MACOS_CODESIGN_OPENSSL_PASSWORD}" \
-in /Users/runner/work/mixxx/mixxx/cmake/macos_developer_id_codesign_certificate.p12.enc \
-out ~/certificate.p12
# Create a temporary keychain for the certificate and import it.
security create-keychain -p mixxx Mixxx.keychain
security unlock-keychain -p mixxx Mixxx.keychain
security import ~/certificate.p12 -k Mixxx.keychain \
-P "${MACOS_CODESIGN_CERTIFICATE_PASSWORD}" -A
security set-key-partition-list -S "apple-tool:,apple:" -k mixxx Mixxx.keychain
# Add keychain to search list
security list-keychains -s Mixxx.keychain
# Prevent keychain access from timing out
security set-keychain-settings Mixxx.keychain
echo "CMAKE_ARGS_EXTRA=${CMAKE_ARGS_EXTRA} -DAPPLE_CODESIGN_IDENTITY=${APPLE_CODESIGN_IDENTITY}" >> "${GITHUB_ENV}"
- name: "[Windows] Set up Windows code signing"
env:
WINDOWS_CODESIGN_CERTIFICATE_PATH: ${{ github.workspace }}\build\certificates\windows_sectigo_codesign_certificate.pfx
WINDOWS_CODESIGN_CERTIFICATE_PASSWORD: ${{ secrets.WINDOWS_CODESIGN_CERTIFICATE_PASSWORD }}
WINDOWS_CODESIGN_SECURE_FILE_SALT: ${{ secrets.WINDOWS_CODESIGN_SECURE_FILE_SALT }}
WINDOWS_CODESIGN_SECURE_FILE_SECRET: ${{ secrets.WINDOWS_CODESIGN_SECURE_FILE_SECRET }}
if: runner.os == 'Windows' && env.WINDOWS_CODESIGN_SECURE_FILE_SALT != null && env.WINDOWS_CODESIGN_SECURE_FILE_SECRET != null
run: |
iex ((New-Object Net.WebClient).DownloadString('https://raw.githubusercontent.com/appveyor/secure-file/master/install.ps1'))
appveyor-tools/secure-file -decrypt "$Env:WINDOWS_CODESIGN_CERTIFICATE_PATH.enc" -secret "$Env:WINDOWS_CODESIGN_SECURE_FILE_SECRET" -salt "$Env:WINDOWS_CODESIGN_SECURE_FILE_SALT"
Add-Content -Path "$Env:GITHUB_ENV" -Value "WINDOWS_CODESIGN_CERTIFICATE_PATH=$Env:WINDOWS_CODESIGN_CERTIFICATE_PATH"
Add-Content -Path "$Env:GITHUB_ENV" -Value "WINDOWS_CODESIGN_CERTIFICATE_PASSWORD=$Env:WINDOWS_CODESIGN_CERTIFICATE_PASSWORD"
Add-Content -Path "$Env:GITHUB_ENV" -Value "CMAKE_ARGS_EXTRA=-DWINDOWS_CODESIGN=ON"
- name: "Set up build environment"
id: buildenv
run: ${{ matrix.buildenv_script }} setup
env:
BUILDENV_BASEPATH: ${{ matrix.buildenv_basepath }}

- name: "Set compiler cache size limit"
# Set size to 2 GiB
run: ${{ matrix.compiler_cache }} -M 2097152

- name: "Set up compiler cache"
uses: actions/cache@v2
with:
path: ${{ matrix.compiler_cache_path }}
key: ${{ matrix.os }}-${{ matrix.compiler_cache }}-${{ github.head_ref }}-${{ github.run_number }}
restore-keys: |
${{ matrix.os }}-${{ matrix.compiler_cache }}-${{ github.head_ref }}
${{ matrix.os }}-${{ matrix.compiler_cache }}
- name: "Create build directory"
run: mkdir cmake_build

- name: "Configure"
run: >-
cmake
-G "${{ matrix.cmake_generator }}"
-DCMAKE_BUILD_TYPE=Release
"-DCMAKE_PREFIX_PATH=${{ env.CMAKE_PREFIX_PATH }}"
-DDEBUG_ASSERTIONS_FATAL=ON
-DQt5_DIR=${{ env.QT_PATH }} ${{ matrix.cmake_args }} ${{ env.CMAKE_ARGS_EXTRA }}
-DBATTERY=ON
-DBROADCAST=ON
-DBULK=ON
-DHID=ON
-DLILV=ON
-DOPUS=ON
-DQTKEYCHAIN=ON
-DVINYLCONTROL=ON
..
working-directory: cmake_build
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}

- name: "[Ubuntu/macOS] Set up gcc/clang problem matcher"
if: runner.os != 'Windows'
uses: ammaraskar/gcc-problem-matcher@master

- name: "[Windows] Set up MSVC problem matcher"
if: runner.os == 'Windows'
uses: ammaraskar/msvc-problem-matcher@master

- name: "Build"
run: cmake --build .
working-directory: cmake_build
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
CMAKE_BUILD_PARALLEL_LEVEL: 2
# GitHub Actions automatically zstd compresses caches
CCACHE_NOCOMPRESS: true
CLCACHE_COMPRESS: false
CLCACHE_HARDLINK: true

- name: "Print compiler cache stats"
run: ${{ matrix.compiler_cache }} -s

- name: "Test"
run: ctest --timeout 45 ${{ matrix.ctest_args }}
working-directory: cmake_build
env:
# Render analyzer waveform tests to an offscreen buffer
QT_QPA_PLATFORM: ${{ matrix.qt_qpa_platform }}
GTEST_COLOR: 1
CTEST_PARALLEL_LEVEL: 2
CTEST_OUTPUT_ON_FAILURE: 1

- name: Benchmark
run: cmake --build . --target mixxx-benchmark
working-directory: cmake_build
env:
# Render analyzer waveform tests to an offscreen buffer
QT_QPA_PLATFORM: ${{ matrix.qt_qpa_platform }}

- name: "Package"
run: cpack -G ${{ matrix.cpack_generator }} -V
working-directory: cmake_build

- name: "[macOS] Sign Package"
if: runner.os == 'macOS' && env.MACOS_CODESIGN_OPENSSL_PASSWORD != null && env.MACOS_CODESIGN_CERTIFICATE_PASSWORD != null
run: codesign --verbose=4 --options runtime --sign "${APPLE_CODESIGN_IDENTITY}" --entitlements ../build/osx/entitlements.plist *.dmg
working-directory: cmake_build

- name: "[Windows] Sign Package"
if: runner.os == 'Windows' && env.WINDOWS_CODESIGN_CERTIFICATE_PATH != null && env.WINDOWS_CODESIGN_CERTIFICATE_PASSWORD != null
run: signtool sign /f $Env:WINDOWS_CODESIGN_CERTIFICATE_PATH /p $Env:WINDOWS_CODESIGN_CERTIFICATE_PASSWORD *.msi
working-directory: cmake_build

- name: "[macOS] Upload build to downloads.mixxx.org"
# skip deploying Ubuntu builds to downloads.mixxx.org because these are deployed to the PPA
if: runner.os == 'macOS' && env.DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY_PASSWORD != null
run: tools/deploy.sh
env:
FILE_TO_DEPLOY: ${{ matrix.artifacts_path }}
OS: ${{ runner.os }}
DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY_PASSWORD: ${{ secrets.DOWNLOADS_HOSTGATOR_DOT_MIXXX_DOT_ORG_KEY_PASSWORD }}
SSH_KEY: build/certificates/downloads-hostgator.mixxx.org.key

- name: "Upload GitHub Actions artifacts"
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifacts_name }}
path: ${{ matrix.artifacts_path }}
87 changes: 87 additions & 0 deletions .github/workflows/clazy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
name: clazy

on:
push:
pull_request:

jobs:
clazy:
runs-on: ubuntu-20.04
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Install build dependencies
run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
libavformat-dev \
libchromaprint-dev \
libebur128-dev \
libfftw3-dev \
libflac-dev \
libid3tag0-dev \
liblilv-dev \
libmad0-dev \
libmodplug-dev \
libmp3lame-dev \
libopus-dev \
libopusfile-dev \
libportmidi-dev \
libprotobuf-dev \
libqt5opengl5-dev \
libqt5sql5-sqlite \
libqt5svg5-dev \
libqt5x11extras5-dev \
librubberband-dev \
libshout3-dev \
libsndfile1-dev \
libsoundtouch-dev \
libsqlite3-dev \
libtag1-dev \
libupower-glib-dev \
libusb-1.0-0-dev \
libwavpack-dev \
portaudio19-dev \
protobuf-compiler \
qt5-default \
qtdeclarative5-dev \
qtscript5-dev \
qt5keychain-dev \
clazy \
cmake
- name: Create build directory
run: mkdir cmake_build
- name: Configure
# Disable optimizations as workaround for Clang 9 bug: https://bugs.llvm.org/show_bug.cgi?id=45034
run: |
cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DWARNINGS_FATAL=ON \
-DOPTIMIZE=off \
-DBATTERY=ON \
-DBROADCAST=ON \
-DBULK=ON \
-DHID=ON \
-DLILV=ON \
-DOPUS=ON \
-DQTKEYCHAIN=ON \
-DVINYLCONTROL=ON \
-DFFMPEG=ON \
-DKEYFINDER=ON \
-DLOCALECOMPARE=ON \
-DMAD=ON \
-DMODPLUG=ON \
-DWAVPACK=ON \
..
working-directory: cmake_build
env:
LD: clang++
CC: clang
CXX: clazy
- name: Set up problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build
# Do not abort on errors and build/check the whole project
run: cmake --build . -j $(nproc) -- --keep-going
working-directory: cmake_build
env:
CLAZY_CHECKS: level2,no-rule-of-two-soft,no-non-pod-global-static,no-qproperty-without-notify,no-wrong-qevent-cast,no-qstring-allocations,no-function-args-by-value,no-copyable-polymorphic,no-ctor-missing-parent-argument,no-missing-qobject-macro,no-rule-of-three,no-returning-void-expression,no-missing-typeinfo,no-base-class-event
Loading

0 comments on commit 20fbcb0

Please sign in to comment.