|
3 | 3 | name: Check Determinism of Encoder Results Across Plaforms and Compilers |
4 | 4 |
|
5 | 5 | # The purpose of this is to show whether the encoding results are |
6 | | -# deterministic across platforms and compilers. Do this by building |
7 | | -# and running the library and tools then running the CTS with an |
8 | | -# option set so it will expect an exact match and won't use ktxdiff. |
| 6 | +# deterministic across platforms and compilers. It does this by building |
| 7 | +# the library and tools then running the CTS with an option set that |
| 8 | +# requires an exact match and won't use ktxdiff. |
| 9 | +# |
| 10 | +# The test is run across macOS, Ubuntu and Windows on both arm64 and x86_64 |
| 11 | +# processors using ktx and libktx compiled with clang and gcc. They are, |
| 12 | +# in addition, compiled with AppleClang on macOS and with ClangCL and msvc |
| 13 | +# on Windows. |
9 | 14 |
|
10 | 15 | on: |
11 | 16 | workflow_dispatch: |
12 | 17 |
|
| 18 | +# macOS runners: clang 17, clang 18 available on $(brew --prefix llvm@18)/bin/clang & gcc-{13,14,15} |
| 19 | +# Linux runners: clang 16, 17, 18 & gcc-{12,13,14} |
| 20 | +# Windows runners: |
13 | 21 | jobs: |
14 | 22 | check-determinism: |
15 | 23 | strategy: |
| 24 | + fail-fast: false |
16 | 25 | matrix: |
17 | | - os: [ macos-latest, macos-15-intel, ubuntu-latest, ubuntu-22.04-arm, windows-latest, windows-11-arm ] |
| 26 | + os: [ macos-latest, macos-15-intel, ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm ] |
| 27 | + compiler: |
| 28 | + - [ clang, clang++ ] |
| 29 | + - [ gcc, g++ ] |
18 | 30 | config: [ Release ] |
19 | 31 | generator: [ 'Ninja Multi-Config' ] |
20 | 32 | exclude: |
21 | | - #- os: [ windows-latest, windows-11-arm ] |
22 | | - - os: windows-latest |
23 | | - generator: 'Ninja Multi-Config' |
| 33 | + - os: macos-latest |
| 34 | + compiler: [ gcc, g++ ] # Here gcc is an alias for clang |
| 35 | + - os: macos-15-intel |
| 36 | + compiler: [ gcc, g++ ] # ditto |
24 | 37 | include: |
25 | | - # The NMC generator defaults to using GCC and GCC names dlls with |
26 | | - # a "lib" prefix and the import files with both the prefix and a |
27 | | - # ".dll.a" extension. I have neither the time nor energy to find out |
28 | | - # how to change the behaviour. Use VS. |
29 | | - #- os: [ windows-latest, windows-11-arm ] |
| 38 | + - os: macos-latest |
| 39 | + compiler: [ gcc-15, g++-15 ] |
| 40 | + config: Release |
| 41 | + generator: 'Ninja Multi-Config' |
| 42 | + - os: macos-latest |
| 43 | + compiler: [ $(brew --prefix llvm@18)/bin/clang, $(brew --prefix llvm@18)/bin/clang++ ] |
| 44 | + config: Release |
| 45 | + generator: 'Ninja Multi-Config' |
| 46 | + - os: macos-15-intel |
| 47 | + compiler: [ gcc-15, g++-15 ] |
| 48 | + config: Release |
| 49 | + generator: 'Ninja Multi-Config' |
| 50 | + - os: macos-15-intel |
| 51 | + compiler: [ $(brew --prefix llvm@18)/bin/clang, $(brew --prefix llvm@18)/bin/clang++ ] |
| 52 | + config: Release |
| 53 | + generator: 'Ninja Multi-Config' |
30 | 54 | - os: windows-latest |
| 55 | + config: Release |
31 | 56 | generator: 'Visual Studio 17 2022' |
| 57 | + toolset: v143 |
| 58 | + - os: windows-latest |
32 | 59 | config: Release |
33 | | - static: OFF |
| 60 | + generator: 'Visual Studio 17 2022' |
| 61 | + toolset: CLangCL |
| 62 | + - os: windows-11-arm |
| 63 | + config: Release |
| 64 | + generator: 'Visual Studio 17 2022' |
| 65 | + toolset: v143 |
| 66 | + - os: windows-11-arm |
| 67 | + config: Release |
| 68 | + generator: 'Visual Studio 17 2022' |
| 69 | + toolset: CLangCL |
34 | 70 |
|
35 | 71 | runs-on: ${{ matrix.os }} |
36 | 72 | env: |
37 | 73 | GIT_LFS_SKIP_SMUDGE: 1 |
38 | | - BUILD_DIR: "build" |
39 | | - WERROR: ON |
| 74 | + BUILD_DIR: build |
| 75 | + STANDARD_OPTIONS: '-D KTX_WERROR=OFF -D LIBKTX_VERSION_READ_ONLY=OFF -D KTX_FEATURE_TOOLS=ON -D KTX_FEATURE_TOOLS_CTS=ON -D KTX_TOOLS_CTS_PRIMARY_PLATFORM=ON -D KTX_FEATURE_TESTS=ON' |
40 | 76 |
|
41 | 77 | steps: |
42 | 78 | - uses: actions/checkout@v6 |
43 | 79 | with: |
44 | 80 | # Fetch all history to make sure tags are |
45 | 81 | # included (used for version creation) |
46 | 82 | fetch-depth: 0 |
| 83 | + # For the CTS submodule. |
| 84 | + submodules: true |
| 85 | + |
| 86 | + - name: Set macOS astcenc ISA override for x86_64 |
| 87 | + if: matrix.os == 'macos-15-intel' |
| 88 | + run: echo ISA_OVERRIDE='-D ASTCENC_ISA_SSE41=ON' >> $GITHUB_ENV |
| 89 | + |
| 90 | + - name: Configure KTX software build for all but Visual Studio |
| 91 | + # Without the ${{ }}, this line generates a YAML syntax error. Do not understand why. |
| 92 | + if: ${{ !startsWith(matrix.generator, 'Visual Studio') }} |
| 93 | + run: cmake -B ${{ env.BUILD_DIR }} -G "${{ matrix.generator }}" -D CMAKE_C_COMPILER=${{ matrix.compiler[0] }} -D CMAKE_CXX_COMPILER=${{ matrix.compiler[1] }} ${{ env.STANDARD_OPTIONS }} ${{ env.ISA_OVERRIDE }} |
47 | 94 |
|
48 | | - - name: Configure KTX software |
49 | | - run: echo 'cmake -B ${{ env.BUILD_DIR }} -G "${{ matrix.generator }}" -D KTX_WERROR=${{ env.WERROR }} -D LIBKTX_VERSION_READ_ONLY=OFF -D KTX_FEATURE_TOOLS=ON -D KTX_FEATURE_TOOLS_CTS=ON -D KTX_TOOLS_CTS_PRIMARY_PLATFORM=ON -D KTX_FEATURE_TESTS ${{ matrix.os }}' |
| 95 | + - name: Configure KTX software build for Visual Studio build |
| 96 | + if: startsWith(matrix.generator, 'Visual Studio') |
| 97 | + run: cmake -B ${{ env.BUILD_DIR }} -G "${{ matrix.generator }}" -T ${{ matrix.toolset }} ${{ env.STANDARD_OPTIONS }} |
50 | 98 |
|
51 | 99 | - name: Build KTX software |
52 | | - run: echo 'cmake --build ${{ env.BUILD_DIR }} --config=${{ matrix.config }} --target=ktxtools' |
| 100 | + run: cmake --build ${{ env.BUILD_DIR }} --config=${{ matrix.config }} --target=ktxtools |
53 | 101 |
|
54 | 102 | - name: Run KTX tools CTS |
55 | | - continue-on-error: true |
56 | | - run: echo 'ctest --output-on-failure --test-dir ${{ BUILD_DIR }} -C Release -R ktxToolsTest' |
| 103 | + run: ctest --output-on-failure --test-dir ${{ env.BUILD_DIR }} -C Release -R ktxToolsTest |
57 | 104 |
|
0 commit comments