Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Change linux CI check to more closely mirror main repo
Browse files Browse the repository at this point in the history
  • Loading branch information
Niam5 committed Dec 11, 2023
1 parent 1fc31ab commit ef39db4
Showing 1 changed file with 32 additions and 68 deletions.
100 changes: 32 additions & 68 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit ef39db4

Please sign in to comment.