diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml new file mode 100644 index 00000000000..57b808c0c3e --- /dev/null +++ b/.github/workflows/meson.yml @@ -0,0 +1,125 @@ +name: Ubuntu meson build + +on: [push] + +env: + # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) + BUILD_TYPE: Release + REPO_DIR : ${{github.workspace}} + BUILD_DIR: ${{github.workspace}}/bin/builddir + BOOST_PLATFORM_VERSION: "22.04" + BOOST_VERSION: "1.79.0" + BOOST_INSTALL_DIR: "${{github.workspace}}/bin" + +jobs: + build: + runs-on: ${{ matrix.os }} + permissions: + contents: read + + strategy: + matrix: + include: + - os: ubuntu-22.04 + COMPILER_CC: gcc-12 + COMPILER_PP: g++-12 + USE_PCH: ON + EXTRA_BUILD: "" + + - os: ubuntu-22.04 + COMPILER_CC: clang + COMPILER_PP: clang++ + USE_PCH: ON + EXTRA_BUILD: "-DBUILD_EXTRACTORS=ON -DBUILD_AHBOT=ON -DBUILD_PLAYERBOT=ON " + + - os: ubuntu-22.04 + COMPILER_CC: clang + COMPILER_PP: clang++ + USE_PCH: OFF + EXTRA_BUILD: "" + + steps: + - uses: actions/setup-python@v1 + - uses: BSFishy/meson-build@v1.0.3 + - name: Checkout + uses: actions/checkout@v2 + with: + path: ${{env.REPO_DIR}} + + - name: Create Build Environment + run: | + 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 + + - name: Cache Windows boost + uses: actions/cache@v2 + id: cache-boost + with: + path: "${{env.BOOST_INSTALL_DIR}}/boost" + key: ${{ runner.os }}-${{ hashFiles('.github/workflows/ubuntu.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: ${{env.COMPILER_CC}} + # OPTIONAL: Specify an architecture + arch: x86 + + - name: Configure + env: + USE_PCH: ${{ matrix.USE_PCH }} + EXTRA_BUILD: ${{ matrix.EXTRA_BUILD }} + BOOST_ROOT: "${{env.BOOST_INSTALL_DIR}}/boost/boost" + run: CC=clang CXX=clang++ meson setup ${{env.REPO_DIR}} ${{env.BUILD_DIR}} + + - name: Build + env: + MAKEFLAGS: "-j8" + run: | + meson configure ${{env.BUILD_DIR}} -Dprefix=/home/runner/work + ninja -C ${{env.BUILD_DIR}} install + + notify: + name: Discord Notification + runs-on: ubuntu-22.04 + permissions: + contents: none + needs: # make sure the notification is sent AFTER the jobs you want included have completed + - build + if: failure() + + steps: + - name: Env + run: | + echo "GIT_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + echo "GIT_SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV + + - name: Notify + uses: rjstone/discord-webhook-notify@v1.0.4 + with: + severity: error + username: ${{env.EXPENSION_NAME}}-core + description: | + **Linux buid failed** + details: | + - **Branch:** ${{env.GIT_BRANCH}} + - **Pusher:** ${{github.event.pusher.name}} + - **Author:** ${{github.event.head_commit.author.name}} + - **Commit:** [${{github.repository}}/${{env.GIT_SHORT_SHA}}](${{github.server_url}}/${{ github.repository }}/commit/${{github.sha}}) + - **Build log:** [actions/runs/${{github.run_id}}](${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}) + footer: Next time ${{github.event.pusher.name}}! + webhookUrl: ${{ secrets.DISCORD_WEBHOOK }} + avatarUrl: https://github.githubassets.com/images/modules/logos_page/Octocat.png