|
| 1 | +name: tests |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + |
| 7 | + pull_request: |
| 8 | + branches: [ main ] |
| 9 | + |
| 10 | + # Run tests once a week on Sunday. |
| 11 | + schedule: |
| 12 | + - cron: "0 6 * * 0" |
| 13 | + |
| 14 | +jobs: |
| 15 | + run-tests: |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + sphinx: [ "5", "6", "7" ] |
| 20 | + cmake: [ "3.20", "3.29" ] |
| 21 | + os: [ "ubuntu", "macos", "windows" ] |
| 22 | + python: [ "3.8", "3.11", "3.12" ] |
| 23 | + |
| 24 | + name: | |
| 25 | + v${{ matrix.sphinx }}-${{ matrix.cmake }} |
| 26 | + [${{ matrix.os }}-py${{ matrix.python }}] |
| 27 | +
|
| 28 | + runs-on: "${{ matrix.os }}-latest" |
| 29 | + |
| 30 | + env: |
| 31 | + BUNDLE_PYTHON_TESTS: ${{ matrix.bundled }} |
| 32 | + |
| 33 | + steps: |
| 34 | + - uses: actions/setup-python@v5 |
| 35 | + with: |
| 36 | + python-version: "${{ matrix.python }}" |
| 37 | + |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + |
| 40 | + - name: Setup cmake |
| 41 | + uses: jwlawson/actions-setup-cmake@v2.0 |
| 42 | + if: ${{matrix.os != 'windows' || matrix.cmake != '3.20'}} |
| 43 | + with: |
| 44 | + cmake-version: "${{ matrix.cmake }}.x" |
| 45 | + |
| 46 | + - name: Setup cmake (Bump up CMake minimal version for Visual Studio 17 2022) |
| 47 | + uses: jwlawson/actions-setup-cmake@v2.0 |
| 48 | + if: ${{matrix.os == 'windows' && matrix.cmake == '3.20'}} |
| 49 | + with: |
| 50 | + # Visual Studio 17 2022 requires at least CMake 3.21. |
| 51 | + # https://cmake.org/cmake/help/latest/generator/Visual%20Studio%2017%202022.html |
| 52 | + cmake-version: "3.21.x" |
| 53 | + |
| 54 | + - name: Install sphinx + sphinx-cmake |
| 55 | + run: pip install . sphinx==${{ matrix.sphinx }}.* |
| 56 | + |
| 57 | + - name: Build Tests |
| 58 | + run: | |
| 59 | + cmake --version |
| 60 | + cmake -S ./test -B ./build |
| 61 | + cmake --build ./build --config Release |
| 62 | +
|
| 63 | + - name: Run Tests |
| 64 | + working-directory: build |
| 65 | + run: ctest -VV -C Release |
0 commit comments