From da8c70dbc6c2c0eb7f418a45fb59350ff068a08b Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Thu, 12 May 2022 12:16:16 +0200 Subject: [PATCH 1/4] Improve CI Add ubuntu 18.04 and 20.04, add debug and relase config... Signed-off-by: Bensuperpc --- .github/workflows/Tests.yml | 51 ++++++++++++++++++++++++++++--------- 1 file changed, 39 insertions(+), 12 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 9da93463..62a88ecd 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -1,28 +1,55 @@ -name: Tests - -on: [push, pull_request] +name: Build and tests + +on: + push: + branches: + - '*' + paths-ignore: + - '**/README.md' + pull_request: + branches: + - '*' + workflow_dispatch: jobs: - Test: - - runs-on: ubuntu-20.04 + build: + name: ${{ matrix.platform.name }} ${{ matrix.config.name }} ${{ matrix.type.name }} + runs-on: ${{ matrix.platform.os }} + + 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 From 927809ecffa2bbdf60cac551bb54162b72bfbcc2 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Thu, 12 May 2022 12:31:57 +0200 Subject: [PATCH 2/4] Fix build fail Fix build fail Signed-off-by: Bensuperpc --- .github/workflows/Tests.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 62a88ecd..0bb93899 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -13,7 +13,7 @@ on: jobs: build: - name: ${{ matrix.platform.name }} ${{ matrix.config.name }} ${{ matrix.type.name }} + name: ${{ matrix.platform.os }} ${{ matrix.config.name }} ${{ matrix.type.name }} runs-on: ${{ matrix.platform.os }} strategy: @@ -44,9 +44,7 @@ jobs: run: sudo apt-get install xorg-dev libglu1-mesa-dev -y - name: Configure - run: | - cmake -B build -S . -DBUILD_TESTING=ON -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic" - ${{ matrix.platform.flags }} ${{ matrix.type.flags }} ${{ matrix.config.flags }} + 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 From 07612b1a903d95138c6cdbe0f22cf8f6e2121470 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Thu, 12 May 2022 12:48:05 +0200 Subject: [PATCH 3/4] Set C++14 and 17 set C++14 and 17 Signed-off-by: Bensuperpc --- .github/workflows/Tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 0bb93899..b70ee191 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -22,10 +22,10 @@ jobs: 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: Linux GCC, os: ubuntu-20.04, flags: -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_STANDARD=17 } + - { name: Linux Clang, os: ubuntu-20.04, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_STANDARD=17 } + - { name: Linux GCC, os: ubuntu-18.04, flags: -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_STANDARD=14 } + - { name: Linux Clang, os: ubuntu-18.04, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_STANDARD=14 } # - { name: MacOS XCode, os: macos-latest } config: - { name: Shared, flags: -DBUILD_SHARED_LIBS=TRUE } From 770b1f290ce328a5f33389c25d3998c235698a49 Mon Sep 17 00:00:00 2001 From: Bensuperpc Date: Thu, 12 May 2022 13:00:53 +0200 Subject: [PATCH 4/4] Fix no newline of file Fix no newline of file Signed-off-by: Bensuperpc --- .github/workflows/Tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index b70ee191..6613b2bb 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -50,4 +50,4 @@ jobs: run: cmake --build build - name: Test - run: ctest --verbose --test-dir build \ No newline at end of file + run: ctest --verbose --test-dir build