diff options
-rw-r--r-- | .github/workflows/build.yml | 19 | ||||
-rwxr-xr-x | tools/macos_buildenv.sh | 37 | ||||
-rwxr-xr-x | tools/ubuntu_buildenv.sh | 19 |
3 files changed, 20 insertions, 55 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fad174fe8a..8408ffe3e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,7 @@ jobs: - name: "[macOS] Get build environment name" if: runner.os == 'macOS' id: buildenv_name - run: ${{ matrix.buildenv_script }} name --ghactions + run: ${{ matrix.buildenv_script }} name - name: "[macOS] Set up build environment cache" if: runner.os == 'macOS' @@ -93,14 +93,10 @@ jobs: - name: "Set up build environment" id: buildenv - run: ${{ matrix.buildenv_script }} setup --ghactions - env: - BUILDENV_BASEPATH: ${{ github.workspace }}/buildenv + run: ${{ matrix.buildenv_script }} setup - name: "Set ccache size limit" run: ccache -M 5G - env: - PATH: ${{ steps.buildenv.outputs.path }} - name: "Set up ccache cache" uses: actions/cache@v2 @@ -131,9 +127,7 @@ jobs: .. working-directory: cmake_build env: - PATH: ${{ steps.buildenv.outputs.path }} - CMAKE_FLAGS_EXTRA: ${{ matrix.cmake_args }} ${{ steps.apple_codesign.outputs.cmake_args }} -DCMAKE_PREFIX_PATH=${{ steps.buildenv.outputs.cmake_prefix_path }} -DQt5_DIR=${{ steps.buildenv.outputs.qt_path }} - MACOSX_DEPLOYMENT_TARGET: ${{ steps.buildenv.outputs.macosx_deployment_target }} + 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: "Set up problem matcher" uses: ammaraskar/gcc-problem-matcher@master @@ -145,18 +139,14 @@ jobs: CMAKE_BUILD_PARALLEL_LEVEL: 2 # GitHub Actions automatically zstd compresses caches CCACHE_NOCOMPRESS: true - PATH: ${{ steps.buildenv.outputs.path }} - name: "Print ccache stats" run: ccache -s - env: - PATH: ${{ steps.buildenv.outputs.path }} - name: "Test" run: ctest --timeout 45 ${{ matrix.ctest_args }} working-directory: cmake_build env: - QT_QPA_PLATFORM_PLUGIN_PATH: ${{ steps.buildenv.outputs.qt_qpa_platform_plugin_path }} # Render analyzer waveform tests to an offscreen buffer QT_QPA_PLATFORM: offscreen GTEST_COLOR: 1 @@ -167,15 +157,12 @@ jobs: run: cmake --build . --target mixxx-benchmark working-directory: cmake_build env: - QT_QPA_PLATFORM_PLUGIN_PATH: ${{ steps.buildenv.outputs.qt_qpa_platform_plugin_path }} # Render analyzer waveform tests to an offscreen buffer QT_QPA_PLATFORM: offscreen - name: "Package" run: cpack -G ${{ matrix.cpack_generator }} working-directory: cmake_build - env: - PATH: ${{ steps.buildenv.outputs.path }} - name: "[macOS] Sign Package" if: runner.os == 'macOS' && env.MACOS_CODESIGN_OPENSSL_PASSWORD != null && env.MACOS_CODESIGN_CERTIFICATE_PASSWORD != null diff --git a/tools/macos_buildenv.sh b/tools/macos_buildenv.sh index 95c3120501..8585e16177 100755 --- a/tools/macos_buildenv.sh +++ b/tools/macos_buildenv.sh @@ -22,11 +22,10 @@ read_envname() { case "$COMMAND" in name) envname="$(read_envname)" - if [ "$1" = "--ghactions" ] + echo "$envname" + if [ -n "${GITHUB_ENV}" ] then - echo "::set-output name=buildenv_name::$envname" - else - echo "$envname" + echo "BUILDENV_NAME=$envname" >> "${GITHUB_ENV}" fi ;; @@ -35,7 +34,7 @@ case "$COMMAND" in if [[ "$BUILDENV_NAME" =~ .*macosminimum([0-9]*\.[0-9]*).* ]] then - MACOSX_DEPLOYMENT_TARGET="${BASH_REMATCH[1]}" + export MACOSX_DEPLOYMENT_TARGET="${BASH_REMATCH[1]}" else echo "Build environment did not match expected pattern. Check cmake/macos_build_environment_name file." >&2 exit 1 @@ -52,10 +51,10 @@ case "$COMMAND" in fi echo "Using build environment: ${BUILDENV_PATH}" - CMAKE_PREFIX_PATH="${BUILDENV_PATH}" - PATH="${BUILDENV_PATH}/bin:${PATH}" - QT_PATH="$(find "${BUILDENV_PATH}" -type d -path "*/cmake/Qt5")" - QT_QPA_PLATFORM_PLUGIN_PATH="$(find "${BUILDENV_PATH}" -type d -path "*/plugins")" + export CMAKE_PREFIX_PATH="${BUILDENV_PATH}" + export PATH="${BUILDENV_PATH}/bin:${PATH}" + export QT_PATH="$(find "${BUILDENV_PATH}" -type d -path "*/cmake/Qt5")" + export QT_QPA_PLATFORM_PLUGIN_PATH="$(find "${BUILDENV_PATH}" -type d -path "*/plugins")" echo "Environent Variables:" echo "- PATH=${PATH}" @@ -66,19 +65,15 @@ case "$COMMAND" in echo "- CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" echo "- Qt5_DIR=${QT_PATH}" - if [ "$1" = "--ghactions" ] + if [ -n "${GITHUB_ENV}" ] then - echo "::set-output name=macosx_deployment_target::${MACOSX_DEPLOYMENT_TARGET}" - echo "::set-output name=cmake_prefix_path::${CMAKE_PREFIX_PATH}" - echo "::set-output name=path::${PATH}" - echo "::set-output name=qt_path::${QT_PATH}" - echo "::set-output name=qt_qpa_platform_plugin_path::${QT_QPA_PLATFORM_PLUGIN_PATH}" - else - export MACOSX_DEPLOYMENT_TARGET - export CMAKE_PREFIX_PATH - export PATH - export QT_PATH - export QT_QPA_PLATFORM_PLUGIN_PATH + { + echo "MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}" + echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" + echo "PATH=${PATH}" + echo "QT_PATH=${QT_PATH}" + echo "QT_QPA_PLATFORM_PLUGIN_PATH=${QT_QPA_PLATFORM_PLUGIN_PATH}" + } >> "${GITHUB_ENV}" fi ;; esac diff --git a/tools/ubuntu_buildenv.sh b/tools/ubuntu_buildenv.sh index fba3609ff6..021b4687f4 100755 --- a/tools/ubuntu_buildenv.sh +++ b/tools/ubuntu_buildenv.sh @@ -7,11 +7,6 @@ shift case "$COMMAND" in name) echo "No build environment needed for Ubuntu, please install dependencies using apt." >&2 - - if [ "$1" = "--ghactions" ] - then - echo "::set-output name=buildenv_name::" - fi ;; setup) @@ -28,7 +23,7 @@ case "$COMMAND" in DISTRIB_CODENAME= esac - if [ ! -z "${DISTRIB_CODENAME}" ] + if [ -n "${DISTRIB_CODENAME}" ] then sudo apt-get update sudo apt-get install -y --no-install-recommends \ @@ -67,17 +62,5 @@ case "$COMMAND" in qtscript5-dev \ ${PACKAGES_EXTRA} fi - - if [ "$1" = "--ghactions" ] - then - QT_QPA_PLATFORM_PLUGIN_PATH="$(qtpaths --plugin-directory)" - - echo "::set-output name=buildenv_path::" - echo "::set-output name=macosx_deployment_target::" - echo "::set-output name=cmake_prefix_path::" - echo "::set-output name=path::${PATH}" - echo "::set-output name=qt_path::" - echo "::set-output name=qt_qpa_platform_plugin_path::${QT_QPA_PLATFORM_PLUGIN_PATH}" - fi ;; esac |