From dccda99debc90218abf9d8f4d35fce3311de584e Mon Sep 17 00:00:00 2001 From: Be Date: Sat, 14 Nov 2020 23:43:49 -0600 Subject: [PATCH] build on GitHub Actions --- .github/workflows/build-environment-build.yml | 61 +++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/build-environment-build.yml diff --git a/.github/workflows/build-environment-build.yml b/.github/workflows/build-environment-build.yml new file mode 100644 index 000000000..11fcd03a3 --- /dev/null +++ b/.github/workflows/build-environment-build.yml @@ -0,0 +1,61 @@ +name: Build + +on: [pull_request, push] + +jobs: + build-mac: + name: macOS + runs-on: macos-10.15 + env: + DEPENDENCY_CACHE: /Users/runner/dependencies + steps: + - name: checkout Git repository + uses: actions/checkout@v2 + - name: dependency cache + uses: actions/cache@v2 + env: + cache-name: dependencies + with: + path: ${{ env.DEPENDENCY_CACHE }} + key: ${{ env.cache-name }}-${{ runner.os}}-${{ hashFiles('download_dependencies.sh') }} + restore-keys: | + ${{ env.cache-name }}-${{ runner.os }} + - name: ccache + uses: actions/cache@v2 + env: + cache-name: ccache + with: + path: /Users/runner/Library/Caches/ccache + key: ${{ env.cache-name }}-${{ runner.os }}-${{ github.head_ref }}-${{ github.run_number }} + restore-keys: | + ${{ env.cache-name }}-${{ runner.os }}-${{ github.head_ref }} + ${{ env.cache-name }}-${{ runner.os }} + - name: build + env: + # 10.12 is the minimum macOS version for Qt 5.12 + MACOSX_DEPLOYMENT_TARGET: 10.12 + BRANCH_NAME: 2.3 + ARCHITECTURE: x86_64 + run: | + # Quit on errors. + # See also: + # - http://mywiki.wooledge.org/BashFAQ/105 + # - https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ + set -e -o pipefail + # Local echo. + set -x + + export MACOSX_SDK=$(xcrun --show-sdk-version) + SHA=`git rev-parse --short HEAD` + ENVIRONMENT_NAME=${BRANCH_NAME}-${SHA}-sdk${MACOSX_SDK}-macosminimum${MACOSX_DEPLOYMENT_TARGET}-${ARCHITECTURE} + + mkdir -p environment/${ENVIRONMENT_NAME} + + scripts/macosx/download_dependencies.sh ${DEPENDENCY_CACHE} + scripts/macosx/build_environment.sh --dependency-cache ${DEPENDENCY_CACHE} --name ${ENVIRONMENT_NAME} --macosx-stdlib libc++ --enable-x86-64 2>&1 | tee environment/${ENVIRONMENT_NAME}/build_environment.log + tar -C environment -czf ${ENVIRONMENT_NAME}.tar.gz ${ENVIRONMENT_NAME} + - name: upload macOS build environment artifact + uses: actions/upload-artifact@v2 + with: + name: macOS-build-environment + path: ./*.tar.gz