build: add strict compiler warning options for MSVC and GCC/Clang #43
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: nfx-stringbuilder - Windows MinGW | |
| on: | |
| push: | |
| branches: [main] | |
| paths-ignore: | |
| - "**/*.md" | |
| - "LICENSE.txt" | |
| - ".gitignore" | |
| pull_request: | |
| branches: [main] | |
| paths-ignore: | |
| - "**/*.md" | |
| - "LICENSE.txt" | |
| - ".gitignore" | |
| env: | |
| BUILD_TYPE: Release | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-windows-mingw: | |
| runs-on: windows-2022 | |
| name: Windows MinGW | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Cache CMake build and ccache | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| build | |
| ${{ runner.temp }}/ccache | |
| key: ${{ runner.os }}-mingw-ninja-${{ hashFiles('**/CMakeLists.txt', 'include/**') }} | |
| restore-keys: | | |
| ${{ runner.os }}-mingw-ninja- | |
| - name: Set up MinGW | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| update: true | |
| install: >- | |
| mingw-w64-x86_64-gcc | |
| mingw-w64-x86_64-cmake | |
| mingw-w64-x86_64-ninja | |
| mingw-w64-x86_64-ccache | |
| - name: Setup ccache | |
| shell: msys2 {0} | |
| run: | | |
| export CCACHE_DIR="${{ runner.temp }}/ccache" | |
| export CCACHE_COMPILERCHECK=content | |
| export CCACHE_COMPRESS=true | |
| export CCACHE_MAXSIZE=200M | |
| mkdir -p "$CCACHE_DIR" | |
| ccache --zero-stats | |
| ccache --show-config | |
| - name: Configure CMake | |
| shell: msys2 {0} | |
| run: | | |
| export CC="ccache gcc" | |
| export CXX="ccache g++" | |
| export CCACHE_DIR="${{ runner.temp }}/ccache" | |
| cmake -B build \ | |
| -G "Ninja" \ | |
| -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | |
| -DNFX_STRINGBUILDER_BUILD_STATIC=ON \ | |
| -DNFX_STRINGBUILDER_BUILD_SHARED=ON \ | |
| -DNFX_STRINGBUILDER_BUILD_TESTS=ON \ | |
| -DNFX_STRINGBUILDER_BUILD_SAMPLES=ON \ | |
| -DNFX_STRINGBUILDER_BUILD_BENCHMARKS=ON \ | |
| -DNFX_STRINGBUILDER_BUILD_DOCUMENTATION=OFF | |
| - name: Build | |
| shell: msys2 {0} | |
| run: | | |
| export CCACHE_DIR="${{ runner.temp }}/ccache" | |
| cmake --build build --parallel | |
| - name: Test | |
| shell: msys2 {0} | |
| working-directory: build | |
| run: ctest --output-on-failure --parallel | |
| - name: Upload test results on failure | |
| if: failure() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-results-windows-mingw | |
| path: | | |
| build/Testing/Temporary/LastTest.log | |
| build/Testing/Temporary/LastTestsFailed.log | |
| retention-days: 7 | |
| - name: Show ccache statistics | |
| shell: msys2 {0} | |
| run: | | |
| export CCACHE_DIR="${{ runner.temp }}/ccache" | |
| ccache --show-stats |