|
| 1 | +name: test |
| 2 | +run-name: Run tests |
| 3 | + |
| 4 | +on: |
| 5 | + workflow_call: |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + |
| 10 | +jobs: |
| 11 | + tests: |
| 12 | + name: Check ${{ matrix.toolchain }} |
| 13 | + runs-on: ${{ matrix.os || 'ubuntu-latest' }} |
| 14 | + container: ${{ !matrix.os && 'ghcr.io/lecrisut/dev-env:main' || '' }} |
| 15 | + continue-on-error: ${{ matrix.experimental || false }} |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + toolchain: [ gcc, llvm, intel, windows, macos ] |
| 20 | + include: |
| 21 | + - os: windows-latest |
| 22 | + toolchain: windows |
| 23 | + - os: macos-latest |
| 24 | + toolchain: macos |
| 25 | + steps: |
| 26 | + - name: Enable msvc toolchain on windows |
| 27 | + uses: ilammy/msvc-dev-cmd@v1 |
| 28 | + if: contains(matrix.os, 'windows') |
| 29 | + - name: Activate Intel compilers |
| 30 | + # Not elegant, it will propagate all environment variable. |
| 31 | + # Intel does not provide a way to output the environment variables to a file |
| 32 | + # Note: PATH needs to be exported to GITHUB_PATH otherwise it can be overwritten |
| 33 | + run: | |
| 34 | + source /opt/intel/oneapi/setvars.sh |
| 35 | + printenv >> $GITHUB_ENV |
| 36 | + echo $PATH >> $GITHUB_PATH |
| 37 | + if: matrix.toolchain == 'intel' |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + - uses: lukka/get-cmake@latest |
| 40 | + - name: Run CMake configuration for ${{ matrix.toolchain }} toolchain |
| 41 | + |
| 42 | + with: |
| 43 | + workflowPreset: "${{ matrix.toolchain }}-ci" |
| 44 | + pass: |
| 45 | + needs: [ tests ] |
| 46 | + runs-on: ubuntu-latest |
| 47 | + steps: |
| 48 | + - name: Check test jobs |
| 49 | + uses: re-actors/alls-green@release/v1 |
| 50 | + with: |
| 51 | + jobs: ${{ toJSON(needs) }} |
| 52 | + if: always() |
0 commit comments