|
1 | | -name: Tests |
2 | | - |
3 | | -on: [push, pull_request] |
| 1 | +name: Build and tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '*' |
| 7 | + paths-ignore: |
| 8 | + - '**/README.md' |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - '*' |
| 12 | + workflow_dispatch: |
4 | 13 |
|
5 | 14 | jobs: |
6 | | - Test: |
7 | | - |
8 | | - runs-on: ubuntu-20.04 |
| 15 | + build: |
| 16 | + name: ${{ matrix.platform.os }} ${{ matrix.config.name }} ${{ matrix.type.name }} |
| 17 | + runs-on: ${{ matrix.platform.os }} |
| 18 | + |
| 19 | + strategy: |
| 20 | + fail-fast: false |
| 21 | + matrix: |
| 22 | + platform: |
| 23 | + # - { name: Windows VS2019, os: windows-2019 } |
| 24 | + # - { name: Windows VS2022, os: windows-2022 } |
| 25 | + - { name: Linux GCC, os: ubuntu-20.04, flags: -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_STANDARD=17 } |
| 26 | + - { name: Linux Clang, os: ubuntu-20.04, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_STANDARD=17 } |
| 27 | + - { name: Linux GCC, os: ubuntu-18.04, flags: -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_CXX_STANDARD=14 } |
| 28 | + - { name: Linux Clang, os: ubuntu-18.04, flags: -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_CXX_STANDARD=14 } |
| 29 | + # - { name: MacOS XCode, os: macos-latest } |
| 30 | + config: |
| 31 | + - { name: Shared, flags: -DBUILD_SHARED_LIBS=TRUE } |
| 32 | + - { name: Static, flags: -DBUILD_SHARED_LIBS=FALSE } |
| 33 | + type: |
| 34 | + - { name: Release, flags: -DCMAKE_BUILD_TYPE=Release } |
| 35 | + - { name: Debug, flags: -DCMAKE_BUILD_TYPE=Debug } |
9 | 36 |
|
10 | 37 | steps: |
11 | 38 | - uses: actions/checkout@v2 |
12 | 39 | with: |
13 | 40 | submodules: recursive |
14 | | - |
15 | | - - name: Update Packages |
16 | | - run: sudo apt-get update |
17 | 41 |
|
18 | | - - name: Install Dependencies |
| 42 | + - name: Install Linux Dependencies |
| 43 | + if: runner.os == 'Linux' |
19 | 44 | run: sudo apt-get install xorg-dev libglu1-mesa-dev -y |
20 | 45 |
|
21 | 46 | - name: Configure |
22 | | - run: cmake -B build . |
| 47 | + run: cmake -B build -S . -DBUILD_TESTING=ON -DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic" ${{ matrix.platform.flags }} ${{ matrix.type.flags }} ${{ matrix.config.flags }} |
23 | 48 |
|
24 | 49 | - name: Build |
25 | 50 | run: cmake --build build |
26 | 51 |
|
27 | 52 | - name: Test |
28 | | - run: ./build/tests/raylib_cpp_test |
| 53 | + run: ctest --verbose --test-dir build |
0 commit comments