From da8c70dbc6c2c0eb7f418a45fb59350ff068a08b Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Thu, 12 May 2022 12:16:16 +0200 Subject: [PATCH] Improve CI Add ubuntu 18.04 and 20.04, add debug and relase config... Signed-off-by: Bensuperpc --- .github/workflows/Tests.yml | 47 +++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 9da9346..62a88ec 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -1,28 +1,55 @@ -name: Tests +name: Build and tests -on: [push, pull_request] +on: + push: + branches: + - '*' + paths-ignore: + - '**/README.md' + pull_request: + branches: + - '*' + workflow_dispatch: jobs: - Test: + build: + name: ${{ matrix.platform.name }} ${{ matrix.config.name }} ${{ matrix.type.name }} + runs-on: ${{ matrix.platform.os }} - runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + platform: + # - { name: Windows VS2019, os: windows-2019 } + # - { name: Windows VS2022, os: windows-2022 } + - { name: Linux GCC, os: ubuntu-20.04, flags: -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ } + - { name: Linux Clang, os: ubuntu-20.04, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } + - { name: Linux GCC, os: ubuntu-18.04, flags: -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ } + - { name: Linux Clang, os: ubuntu-18.04, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ } + # - { name: MacOS XCode, os: macos-latest } + config: + - { name: Shared, flags: -DBUILD_SHARED_LIBS=TRUE } + - { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE } + type: + - { name: Release, flags: -DCMAKE_BUILD_TYPE=Release } + - { name: Debug, flags: -DCMAKE_BUILD_TYPE=Debug } steps: - uses: actions/checkout@v2 with: submodules: recursive - - - name: Update Packages - run: sudo apt-get update - - name: Install Dependencies + - name: Install Linux Dependencies + if: runner.os == 'Linux' run: sudo apt-get install xorg-dev libglu1-mesa-dev -y - name: Configure - run: cmake -B build . + run: | + cmake -B build -S . -DBUILD_TESTING=ON -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic" + ${{ matrix.platform.flags }} ${{ matrix.type.flags }} ${{ matrix.config.flags }} - name: Build run: cmake --build build - name: Test - run: ./build/tests/raylib_cpp_test + run: ctest --verbose --test-dir build \ No newline at end of file