|
| 1 | +name: Windows builds |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + # available environments: https://github.com/actions/virtual-environments |
| 8 | + name: ${{matrix.config.name}} ${{matrix.build_type}} |
| 9 | + runs-on: ${{matrix.config.os}} |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + config: |
| 14 | + - { |
| 15 | + name: "vs-15-2017-win64-cxx11", |
| 16 | + os: windows-2016, |
| 17 | + generator: "Visual Studio 15 2017", |
| 18 | + std: 11, |
| 19 | + test_target: RUN_TESTS, |
| 20 | + } |
| 21 | + - { |
| 22 | + name: "vs-16-2019-win64-cxx11", |
| 23 | + os: windows-2019, |
| 24 | + generator: "Visual Studio 16 2019", |
| 25 | + std: 11, |
| 26 | + test_target: RUN_TESTS, |
| 27 | + } |
| 28 | + - { |
| 29 | + name: "vs-16-2019-win64-cxx17", |
| 30 | + os: windows-2019, |
| 31 | + generator: "Visual Studio 16 2019", |
| 32 | + std: 17, |
| 33 | + test_target: RUN_TESTS, |
| 34 | + } |
| 35 | + - { |
| 36 | + name: "mingw-cxx11", |
| 37 | + os: windows-latest, |
| 38 | + generator: "MinGW Makefiles", |
| 39 | + std: 11, |
| 40 | + test_target: test, |
| 41 | + } |
| 42 | + - { |
| 43 | + name: "mingw-cxx17", |
| 44 | + os: windows-latest, |
| 45 | + generator: "MinGW Makefiles", |
| 46 | + std: 17, |
| 47 | + test_target: test, |
| 48 | + } |
| 49 | + build_type: [Debug] #, Release] |
| 50 | + ARCH: ["x64"] |
| 51 | + |
| 52 | + steps: |
| 53 | + - uses: actions/checkout@v2 |
| 54 | + |
| 55 | + # Visual Studio build steps |
| 56 | + - name: Configure build MSVC |
| 57 | + if: ${{ startswith(matrix.config.name, 'vs-') }} |
| 58 | + shell: powershell |
| 59 | + run: cmake -S . -B ${{runner.workspace}}/build_${{matrix.config.name}}_${{matrix.build_type}} -G "${{matrix.config.generator}}" -A "${{matrix.ARCH}}" -DCMAKE_CXX_STANDARD=${{matrix.config.std}} -DCMAKE_CXX_EXTENSIONS=OFF |
| 60 | + - name: Build MSVC |
| 61 | + if: ${{ startswith(matrix.config.name, 'vs-') }} |
| 62 | + shell: powershell |
| 63 | + run: cmake --build ${{runner.workspace}}/build_${{matrix.config.name}}_${{matrix.build_type}} --config ${{matrix.build_type}} |
| 64 | + |
| 65 | + # mingw build steps |
| 66 | + - name: Configure build MinGW |
| 67 | + if: ${{ startswith(matrix.config.name, 'mingw-') }} |
| 68 | + shell: powershell |
| 69 | + run: cmake -S . -B ${{runner.workspace}}/build_${{matrix.config.name}}_${{matrix.build_type}} -G "${{matrix.config.generator}}" -DCMAKE_CXX_STANDARD=${{matrix.config.std}} -DCMAKE_CXX_EXTENSIONS=OFF -DCMAKE_BUILD_TYPE=${{matrix.build_type}} |
| 70 | + - name: Build MinGW |
| 71 | + if: ${{ startswith(matrix.config.name, 'mingw-') }} |
| 72 | + shell: powershell |
| 73 | + run: cmake --build ${{runner.workspace}}/build_${{matrix.config.name}}_${{matrix.build_type}} |
| 74 | + |
| 75 | + - name: Run tests |
| 76 | + shell: powershell |
| 77 | + env: |
| 78 | + CTEST_OUTPUT_ON_FAILURE: 1 |
| 79 | + run: cmake --build ${{runner.workspace}}/build_${{matrix.config.name}}_${{matrix.build_type}} --target ${{matrix.config.test_target}} |
0 commit comments