From 78c131d8ed553d56753a8e9944605deaf6b95051 Mon Sep 17 00:00:00 2001 From: Cyberium Date: Sat, 28 May 2022 15:26:54 +0200 Subject: [PATCH] More improvement to github action script make ubuntu and macos build using boost 1.79.0 too Make use of caching for boost folder + some minor changes --- .github/workflows/macos.yml | 37 +++++++++++++++++++++++++++++++++--- .github/workflows/ubuntu.yml | 33 +++++++++++++++++--------------- 2 files changed, 52 insertions(+), 18 deletions(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 6bbb1c1b414..71acacfb778 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -7,13 +7,18 @@ env: BUILD_TYPE: Release REPO_DIR : ${{github.workspace}} BUILD_DIR: ${{github.workspace}}/bin/builddir + BOOST_PLATFORM_VERSION: "11" + BOOST_VERSION: "1.79.0" + BOOST_INSTALL_DIR: "${{github.workspace}}/bin" permissions: contents: read jobs: build: - runs-on: macos-10.15 + runs-on: macos-11 + permissions: + contents: read steps: - name: Checkout @@ -23,12 +28,38 @@ jobs: - name: Install dependencies run: | - brew install boost mysql-client + brew install mysql-client brew install openssl echo "OPENSSL_ROOT_DIR=$(brew --prefix --installed openssl)" >> $GITHUB_ENV + mkdir -p ${{env.BOOST_INSTALL_DIR}} + + - name: Cache Windows boost + uses: actions/cache@v2 + id: cache-boost + with: + path: "${{env.BOOST_INSTALL_DIR}}/boost" + key: ${{ runner.os }}-${{ hashFiles('.github/workflows/macos.yml') }} + + - if: steps.cache-boost.outputs.cache-hit != 'true' + name: Install boost + uses: MarkusJx/install-boost@v2.3.0 + id: install-boost + with: + # REQUIRED: Specify the required boost version + # A list of supported versions can be found here: + # https://github.com/actions/boost-versions/blob/main/versions-manifest.json + boost_version: ${{env.BOOST_VERSION}} + # OPTIONAL: Specify a platform version + platform_version: ${{env.BOOST_PLATFORM_VERSION}} + # OPTIONAL: Specify a custom install location + boost_install_dir: ${{env.BOOST_INSTALL_DIR}} + # OPTIONAL: Specify a toolset + toolset: clang - name: Configure - run: cmake -DBoost_ARCHITECTURE=-x64 -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} + env: + BOOST_ROOT: "${{env.BOOST_INSTALL_DIR}}/boost/boost" + run: cmake -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} -DBoost_ARCHITECTURE=-x64 - name: Build env: diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index eaafff7d6ee..53508ebc95e 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -7,13 +7,16 @@ env: BUILD_TYPE: Release REPO_DIR : ${{github.workspace}} BUILD_DIR: ${{github.workspace}}/bin/builddir - BOOST_PLATFORM_VERSION: "18.04" - BOOST_VERSION: "1.73.0" + BOOST_PLATFORM_VERSION: "20.04" + BOOST_VERSION: "1.79.0" BOOST_INSTALL_DIR: "${{github.workspace}}/bin" jobs: build: runs-on: ${{ matrix.os }} + permissions: + contents: read + strategy: matrix: include: @@ -40,14 +43,12 @@ jobs: - name: Create Build Environment run: | - echo "BOOST_ROOT=${{env.BOOST_INSTALL_DIR}}/boost/boost-${{env.BOOST_VERSION}}-linux-${{env.BOOST_PLATFORM_VERSION}}-gcc-x64" >> $GITHUB_ENV echo "GITHUB_SHORT_REV=$(git rev-parse --short HEAD)" >> $GITHUB_ENV echo "ARCHIVE_FILENAME=${{ github.event.repository.name }}-$(git rev-parse --short HEAD).zip" >> $GITHUB_ENV echo "CC=${{matrix.COMPILER_CC}}" >> $GITHUB_ENV echo "CXX=${{matrix.COMPILER_PP}}" >> $GITHUB_ENV - cmake -E make_directory ${{ env.BUILD_DIR }} - - # install dependencies + cmake -E make_directory ${{ env.BUILD_DIR }} + - name: Cache Windows boost uses: actions/cache@v2 id: cache-boost @@ -57,23 +58,26 @@ jobs: - if: steps.cache-boost.outputs.cache-hit != 'true' name: Install boost - uses: MarkusJx/install-boost@v1.0.1 + uses: MarkusJx/install-boost@v2.3.0 id: install-boost with: # REQUIRED: Specify the required boost version - # A list of supported versions can be found here: + # A list of supported versions can be found here: # https://github.com/actions/boost-versions/blob/main/versions-manifest.json boost_version: ${{env.BOOST_VERSION}} - # OPTIONAL: Specify a platform version on ubuntu + # OPTIONAL: Specify a platform version platform_version: ${{env.BOOST_PLATFORM_VERSION}} - # OPTIONAL: Specify a custon install location + # OPTIONAL: Specify a custom install location boost_install_dir: ${{env.BOOST_INSTALL_DIR}} - # NOTE: If a boost version matching all requirements cannot be found, - # this build step will fail + # OPTIONAL: Specify a toolset + toolset: ${{env.COMPILER_CC}} + # OPTIONAL: Specify an architecture + arch: x86 - name: Configure env: USE_PCH: ${{ matrix.USE_PCH }} + BOOST_ROOT: "${{env.BOOST_INSTALL_DIR}}/boost/boost" run: cmake -DBoost_ARCHITECTURE=-x64 -DPCH=$USE_PCH -B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} - name: Build @@ -82,10 +86,10 @@ jobs: run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} notify: - permissions: - contents: none name: Discord Notification runs-on: ubuntu-20.04 + permissions: + contents: none needs: # make sure the notification is sent AFTER the jobs you want included have completed - build if: failure() @@ -112,4 +116,3 @@ jobs: footer: Next time ${{github.event.pusher.name}}! webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} avatarUrl: https://github.githubassets.com/images/modules/logos_page/Octocat.png -