|
| 1 | +# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform. |
| 2 | +# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml |
| 3 | +name: ubuntu-build |
| 4 | + |
| 5 | +on: |
| 6 | + push: |
| 7 | + branches: [ "Playerbot", "test-staging" ] |
| 8 | + pull_request: |
| 9 | + branches: [ "Playerbot", "test-staging" ] |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + strategy: |
| 14 | + # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + # the result of the matrix will be the combination of all attributes, so we get os*compiler builds |
| 18 | + include: |
| 19 | + - os: ubuntu-22.04 |
| 20 | + c_compiler: clang |
| 21 | + cpp_compiler: clang++ |
| 22 | + build_type: Release |
| 23 | + - os: ubuntu-22.04 |
| 24 | + c_compiler: gcc |
| 25 | + cpp_compiler: g++ |
| 26 | + build_type: Release |
| 27 | + - os: ubuntu-24.04 |
| 28 | + c_compiler: gcc |
| 29 | + cpp_compiler: g++ |
| 30 | + build_type: Release |
| 31 | + |
| 32 | + runs-on: ${{ matrix.os }} |
| 33 | + name: ${{ matrix.os }}-${{ matrix.cpp_compiler }} |
| 34 | + |
| 35 | + steps: |
| 36 | + - name: Checkout AzerothCore |
| 37 | + uses: actions/checkout@v3 |
| 38 | + |
| 39 | + - name: Set reusable strings |
| 40 | + # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. |
| 41 | + id: strings |
| 42 | + shell: bash |
| 43 | + run: | |
| 44 | + echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" |
| 45 | + |
| 46 | + # - name: Clone Playerbot Module |
| 47 | + # run: git clone --depth=1 --branch=master https://github.com/mod-playerbots/mod-playerbots.git modules/mod-playerbots |
| 48 | + |
| 49 | + # - name: Checkout Playerbot Module |
| 50 | + # uses: actions/checkout@v3 |
| 51 | + # with: |
| 52 | + # repository: 'mod-playerbots/mod-playerbots' |
| 53 | + # path: 'modules/mod-playerbots' |
| 54 | + |
| 55 | + - name: Install Requirements |
| 56 | + run: sudo apt-get update && sudo apt-get install git cmake make gcc g++ clang libmysqlclient-dev libssl-dev libbz2-dev libreadline-dev libncurses-dev mysql-server libboost-all-dev |
| 57 | + |
| 58 | + # - name: Cache |
| 59 | + # uses: actions/cache@v3 |
| 60 | + # with: |
| 61 | + # path: var/ccache |
| 62 | + # key: ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.modules }}-modules:${{ github.ref }}:${{ github.sha }} |
| 63 | + # restore-keys: | |
| 64 | + # ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.modules }}-modules:${{ github.ref }} |
| 65 | + # ccache:${{ matrix.os }}:${{ matrix.compiler }}:${{ matrix.modules }}-modules |
| 66 | + |
| 67 | + # - name: Configure OS |
| 68 | + # run: source ./acore.sh install-deps |
| 69 | + # env: |
| 70 | + # CONTINUOUS_INTEGRATION: true |
| 71 | + |
| 72 | + # - name: Create conf/config.sh |
| 73 | + # run: source ./apps/ci/ci-conf-core.sh |
| 74 | + |
| 75 | + # - name: Process pending sql |
| 76 | + # run: bash bin/acore-db-pendings |
| 77 | + |
| 78 | + # - name: Build |
| 79 | + # run: source ./apps/ci/ci-compile.sh |
| 80 | + |
| 81 | + - name: Configure CMake |
| 82 | + # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. |
| 83 | + # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type |
| 84 | + run: > |
| 85 | + cmake -B ${{ steps.strings.outputs.build-output-dir }} |
| 86 | + -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} |
| 87 | + -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} |
| 88 | + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} |
| 89 | + -S ${{ github.workspace }} |
| 90 | +
|
| 91 | + - name: Build |
| 92 | + # Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). |
| 93 | + run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} |
| 94 | + |
| 95 | + # - name: Test |
| 96 | + # working-directory: ${{ steps.strings.outputs.build-output-dir }} |
| 97 | + # # Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator). |
| 98 | + # # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail |
| 99 | + # run: ctest --build-config ${{ matrix.build_type }} |
0 commit comments