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: ccache_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: ccache_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 ccache_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 2016 (MSVC) os: windows-2016 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.(FullIntroOutro_LongerOutro|EnabledSuccess_DecksStopped|FadeToDeck1_LoadOnDeck2_TrackLoadFailed|FadeToDeck2_LoadOnDeck1_TrackLoadSuccess)$' cpack_generator: WIX 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: "[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 CMAKE_ARGS="-DAPPLE_CODESIGN_IDENTITY=${APPLE_CODESIGN_IDENTITY}" echo "::set-output name=cmake_args::${CMAKE_ARGS}" - name: "Set up build environment" id: buildenv run: ${{ matrix.buildenv_script }} setup env: BUILDENV_BASEPATH: ${{ matrix.buildenv_basepath }} - name: "Set ccache size limit" if: runner.os != 'Windows' run: ccache -M 5G - name: "Set up ccache cache" if: runner.os != 'Windows' uses: actions/cache@v2 with: path: ${{ matrix.ccache_path }} key: ${{ matrix.os }}-ccache-${{ github.head_ref }}-${{ github.run_number }} restore-keys: | ${{ matrix.os }}-ccache-${{ github.head_ref }} ${{ matrix.os }}-ccache - name: "Create build directory" run: mkdir cmake_build - name: "[Windows] Set up MSVC Developer Command Prompt" if: runner.os == 'Windows' uses: ilammy/msvc-dev-cmd@v1 with: toolset: 14.16 - name: "Configure" run: > cmake -G "${{ matrix.cmake_generator }}" -DCMAKE_BUILD_TYPE=Release -DBATTERY=ON -DBROADCAST=ON -DBULK=ON -DDEBUG_ASSERTIONS_FATAL=ON -DHID=ON -DLILV=ON -DOPUS=ON -DQTKEYCHAIN=ON -DVINYLCONTROL=ON ${{ env.CMAKE_FLAGS_EXTRA }} .. working-directory: cmake_build env: CC: ${{ matrix.cc }} CXX: ${{ matrix.cxx }} CMAKE_FLAGS_EXTRA: ${{ matrix.cmake_args }} ${{ steps.apple_codesign.outputs.cmake_args }} "-DCMAKE_PREFIX_PATH=${{ env.CMAKE_PREFIX_PATH }}" "-DQt5_DIR=${{ env.QT_PATH }}" - 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 - name: "Print ccache stats" if: runner.os != 'Windows' run: ccache -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 }} 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: "[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 }}