Update unit test output #116
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Modules | |
| on: | |
| push: | |
| branches: | |
| - master | |
| - v*/dev | |
| - ci/* | |
| - dev/* | |
| paths: | |
| - '.github/workflows/modules.yml' | |
| - 'benchmark/**' | |
| - 'cmake/**' | |
| - 'examples/**' | |
| - 'include/**' | |
| - 'src/**' | |
| - 'tests/**' | |
| - '**/CMakeLists.txt' | |
| pull_request: | |
| branches: | |
| - master | |
| - v*/dev | |
| - ci/* | |
| - dev/* | |
| paths: | |
| - '.github/workflows/modules.yml' | |
| - 'benchmark/**' | |
| - 'cmake/**' | |
| - 'examples/**' | |
| - 'include/**' | |
| - 'src/**' | |
| - 'tests/**' | |
| - '**/CMakeLists.txt' | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}-${{ github.event_name == 'schedule' }}-${{ github.event.schedule }} | |
| cancel-in-progress: true | |
| env: | |
| APT_INSTALL: | | |
| sudo apt-get install | |
| -yq --no-install-suggests --no-install-recommends | |
| --allow-unauthenticated --allow-downgrades --allow-change-held-packages | |
| jobs: | |
| ubuntu: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| cmake: | |
| # CMake 3.28 has native modules support | |
| - "~3.28.0" | |
| # 3.27 doesn't, so we need to emulate it in other ways | |
| - "~3.27.0" | |
| generator: | |
| - Ninja | |
| - Unix Makefiles | |
| cxx: | |
| #- g++-14 # ICEs in compilation | |
| - clang++-18 | |
| external_deps: [ 0, 1 ] | |
| exclude: | |
| # CMake native modules are incompatible with makefiles | |
| - cmake: "~3.28.0" | |
| generator: Unix Makefiles | |
| env: | |
| CXX: ${{ matrix.cxx }} | |
| steps: | |
| - name: Setup CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: ${{ matrix.cmake }} | |
| # No ccache, don't want to add additional variables to already finicky modules stuff | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Build fast_float | |
| if: matrix.external_deps == 1 | |
| run: | | |
| git clone https://github.com/fastfloat/fast_float -b v6.1.1 --depth=1 | |
| cd fast_float | |
| mkdir build | |
| cd build | |
| cmake -G "${{ matrix.generator }}" .. | |
| cmake --build . | |
| sudo cmake --build . --target install | |
| - name: Run CMake | |
| run: | | |
| mkdir ${{ runner.workspace }}/lib-build | |
| cd ${{ runner.workspace }}/lib-build | |
| if [[ ${{ matrix.external_deps }} -eq 1 ]]; then | |
| cmake -G "${{ matrix.generator }}" -DSCN_INSTALL=ON \ | |
| -DSCN_USE_EXTERNAL_FAST_FLOAT=ON -DSCN_MODULES=ON \ | |
| $GITHUB_WORKSPACE | |
| else | |
| cmake -G "${{ matrix.generator }}" -DSCN_INSTALL=ON \ | |
| -DSCN_MODULES=ON $GITHUB_WORKSPACE | |
| fi | |
| - name: Build | |
| working-directory: ${{ runner.workspace }}/lib-build | |
| run: | | |
| cmake --build . --verbose | |
| - name: Test | |
| working-directory: ${{ runner.workspace }}/lib-build | |
| run: | | |
| ctest --output-on-failure | |
| - name: Install | |
| working-directory: ${{ runner.workspace }}/lib-build | |
| run: | | |
| sudo cmake --build . --target install | |
| - name: Build consumer | |
| run: | | |
| mkdir ${{ runner.workspace }}/consumer-build | |
| cd ${{ runner.workspace }}/consumer-build | |
| cmake -G "${{ matrix.generator }}" $GITHUB_WORKSPACE/tests/consumer-test/module | |
| cmake --build . --verbose | |
| - name: Test consumer | |
| working-directory: ${{ runner.workspace }}/consumer-build | |
| run: | | |
| output="$(echo '42' | ./scn-consumer-module)" | |
| test "$output" -eq 42 | |
| windows: | |
| runs-on: windows-2022 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| cmake: | |
| - "~3.28.0" | |
| # Can't find .ifc files, possibly the fault of our CMake | |
| # - "~3.27.0" | |
| generator: | |
| # Can't find the stdlib headers, don't want to figure out why | |
| # - Ninja Multi-Config | |
| - Visual Studio 17 2022 | |
| steps: | |
| - name: Setup CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: ${{ matrix.cmake }} | |
| # No ccache, don't want to add additional variables to already finicky modules stuff | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| - name: Setup environment | |
| run: | | |
| cmake -E make_directory ${{ runner.workspace }}/lib-build | |
| cmake -E make_directory ${{ runner.workspace }}/consumer-build | |
| - name: Run CMake | |
| shell: cmd | |
| working-directory: ${{ runner.workspace }}/lib-build | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
| cmake -G "${{ matrix.generator }}" -DSCN_INSTALL=ON -DSCN_MODULES=ON ${{ github.workspace }} | |
| - name: Build | |
| working-directory: ${{ runner.workspace }}/lib-build | |
| run: | | |
| cmake --build . --config Debug --parallel --verbose | |
| - name: Test | |
| working-directory: ${{ runner.workspace }}/lib-build | |
| run: | | |
| ctest --output-on-failure -C Debug | |
| - name: Install | |
| working-directory: ${{ runner.workspace }}/lib-build | |
| run: | | |
| cmake --build . --target install | |
| - name: Build consumer | |
| shell: cmd | |
| working-directory: ${{ runner.workspace }}/consumer-build | |
| run: | | |
| call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" | |
| cmake -G "${{ matrix.generator }}" ${{ github.workspace }}/tests/consumer-test/module | |
| cmake --build . --config Debug --parallel --verbose | |
| - name: Test consumer | |
| working-directory: ${{ runner.workspace }}/consumer-build | |
| shell: bash | |
| run: | | |
| output="$(echo '42' | ./Debug/scn-consumer-module.exe)" | |
| test "$output" -eq 42 |