|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +env: |
| 6 | + BUILD_TYPE: Release |
| 7 | + |
| 8 | +jobs: |
| 9 | + build: |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + platform: |
| 14 | + - { name: Ubuntu GCC, os: ubuntu-latest, compiler: g++, arch: "64", flags: ""} |
| 15 | + - { name: Ubuntu Clang, os: ubuntu-latest, compiler: clang++, arch: "64", flags: ""} |
| 16 | + - { name: Windows 32, os: windows-latest, compiler: vs2019, arch: "32", flags: "-A Win32"} |
| 17 | + - { name: Windows 64, os: windows-latest, compiler: vs2019, arch: "64", flags: "-A x64"} |
| 18 | + - { name: MacOS, os: macos-latest, compiler: clang++, arch: "64", flags: ""} |
| 19 | + |
| 20 | + name: ${{matrix.platform.name}} |
| 21 | + runs-on: ${{matrix.platform.os}} |
| 22 | + |
| 23 | + steps: |
| 24 | + - name: Checkout code |
| 25 | + uses: actions/checkout@v2 |
| 26 | + with: |
| 27 | + submodules: 'recursive' |
| 28 | + |
| 29 | + - name: Setup Linux compiler |
| 30 | + if: runner.os == 'Linux' |
| 31 | + run: export CXX=${{matrix.platform.compiler}} |
| 32 | + |
| 33 | + - name: Create Build Environment |
| 34 | + run: cmake -E make_directory ${{github.workspace}}/build |
| 35 | + |
| 36 | + - name: Configure CMake |
| 37 | + shell: bash |
| 38 | + working-directory: ${{github.workspace}}/build |
| 39 | + run: cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${{matrix.platform.flags}} -DOUP_DO_TEST=1 |
| 40 | + |
| 41 | + - name: Build |
| 42 | + shell: bash |
| 43 | + working-directory: ${{github.workspace}}/build |
| 44 | + run: cmake --build . --config ${BUILD_TYPE} --parallel 2 |
| 45 | + |
| 46 | + - name: Install |
| 47 | + shell: bash |
| 48 | + working-directory: ${{github.workspace}}/build |
| 49 | + run: cmake --install . --config ${BUILD_TYPE} |
| 50 | + |
| 51 | + - name: Test |
| 52 | + shell: bash |
| 53 | + working-directory: ${{github.workspace}}/build |
| 54 | + run: ctest |
| 55 | + |
0 commit comments