From ef39db4946470ff1e0e8fa46fccaa87bc5a024a8 Mon Sep 17 00:00:00 2001 From: Niam5 Date: Sun, 10 Dec 2023 21:18:37 -0600 Subject: [PATCH] Change linux CI check to more closely mirror main repo --- .github/workflows/ubuntu.yml | 100 +++++++++++------------------------ 1 file changed, 32 insertions(+), 68 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index aa8d834177..17c1c8ffe6 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -2,74 +2,38 @@ name: Ubuntu 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 - 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: 1 -# EXTRA_BUILD: "" - - - os: ubuntu-22.04 - COMPILER_CC: clang-14 - COMPILER_PP: clang++-14 - USE_PCH: 1 - EXTRA_BUILD: "-DTOOLS=1 " - - - os: ubuntu-22.04 - COMPILER_CC: clang-14 - COMPILER_PP: clang++-14 - USE_PCH: 0 - EXTRA_BUILD: "" - + runs-on: ubuntu-20.04 steps: - - name: Checkout - uses: actions/checkout@v3 - with: - path: ${{env.REPO_DIR}} - submodules: true - - - 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 - cmake -E make_directory ${{ env.BUILD_DIR }} - - - name: Install Dependencies - run: | - sudo apt-get update && sudo apt-get install -yq libboost-all-dev - - - name: Configure - env: - USE_PCH: ${{ matrix.USE_PCH }} - EXTRA_BUILD: ${{ matrix.EXTRA_BUILD }} - run: cmake -DUSE_COREPCH=${{env.USE_PCH}} -DUSE_SCRIPTPCH=${{env.USE_PCH}} -DELUNA=1 -DNOJEM=0 -DSCRIPTS=static -DSERVERS=1 ${{env.EXTRA_BUILD}}-B ${{env.BUILD_DIR}} -S ${{env.REPO_DIR}} -DCMAKE_INSTALL_PREFIX=check_install -DBUILD_TESTING=1 - - - name: Build - env: - MAKEFLAGS: "-j8" - run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} && cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} -- install - - - name: Unit tests - run: cmake --build ${{env.BUILD_DIR}} --config ${{env.BUILD_TYPE}} -- test - - - name: Check executables - run: | - cd check_install/bin - ./bnetserver --version - ./worldserver --version + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Dependencies + run: | + sudo apt-get update && sudo apt-get install -yq libboost-all-dev g++-10 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 + + - name: Setup + run: | + mkdir bin + cd bin + cmake ../ -DWITH_COREDEBUG=0 -DUSE_COREPCH=1 -DUSE_SCRIPTPCH=1 -DELUNA=1 -DTOOLS=1 -DSCRIPTS=static -DSERVERS=1 -DNOJEM=0 -DCMAKE_INSTALL_PREFIX=check_install -DBUILD_TESTING=1 + cd .. + + - name: Build + run: | + cd bin + make -j 4 -k && make install + + - name: Unit tests + run: | + cd bin + make test + + - name: Check executables + run: | + cd bin/check_install/bin + ./bnetserver --version + ./worldserver --version \ No newline at end of file