|
| 1 | +name: Linux |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ dev ] |
| 8 | + paths-ignore: |
| 9 | + - 'Docker' |
| 10 | + - '**/README.md' |
| 11 | + - '**/LICENCE' |
| 12 | + |
| 13 | +jobs: |
| 14 | + linux-build-and-test: |
| 15 | + # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. |
| 16 | + # You can convert this to a matrix build if you need cross-platform coverage. |
| 17 | + # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + target: ["release","debug"] |
| 22 | + os: ["ubuntu-22.04","ubuntu-22.04-arm"] |
| 23 | + |
| 24 | + runs-on: ${{matrix.os}} |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v2 |
| 27 | + with: |
| 28 | + submodules: recursive |
| 29 | + |
| 30 | + - name: Install job dependencies |
| 31 | + run : | |
| 32 | + sudo apt-get update |
| 33 | + sudo apt-get install -y ninja-build wget build-essential |
| 34 | +
|
| 35 | + - name: Install CMake 3.31.5 |
| 36 | + shell: bash |
| 37 | + run: | |
| 38 | + set +xe |
| 39 | + which cmake &> /dev/null |
| 40 | + if [ $? -ne 0 ]; then |
| 41 | + arch=$([ $(uname -m) = "arm64" ] && echo "aarch64" || echo "x86_64") |
| 42 | + cmake_script="cmake-3.31.5-linux-$arch.sh" |
| 43 | + wget "https://github.com/Kitware/CMake/releases/download/v3.31.5/$cmake_script" |
| 44 | + chmod +x $cmake_script |
| 45 | + sudo ./$cmake_script --skip-license --prefix=/usr/local |
| 46 | + fi |
| 47 | + CMAKE_VERSION=$(cmake --version | awk '/version/ {print $3}') |
| 48 | + echo "Using cmake: ${CMAKE_VERSION}" |
| 49 | + - name: Configure CMake |
| 50 | + shell: bash |
| 51 | + run: | |
| 52 | + echo "Generating CMake for Target: ${{matrix.target}}" |
| 53 | + ./gen_cmake.sh -o _build -${{matrix.target}} -c Ninja |
| 54 | +
|
| 55 | + - name: Build |
| 56 | + # Build your program with the given configuration |
| 57 | + run: cmake --build _build |
| 58 | + |
| 59 | + - name: Test |
| 60 | + working-directory: ${{github.workspace}}/_build/tests/src |
| 61 | + shell: bash |
| 62 | + run: | |
| 63 | + test_cmd="./Tests --gtest_filter=-MANUAL*" |
| 64 | + if [ "${{matrix.target}}" = "debug" ]; then |
| 65 | + test_cmd="./Tests-d --gtest_filter=-MANUAL*" |
| 66 | + fi |
| 67 | + eval $test_cmd |
0 commit comments