build: add strict compiler warning options for MSVC and GCC/Clang #35
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-datetime - Linux GCC | |
| 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-linux-gcc: | |
| runs-on: ubuntu-latest | |
| name: Ubuntu GCC 14 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Cache CMake build | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| build | |
| ~/.cache/ccache | |
| key: ${{ runner.os }}-gcc14-cmake-${{ hashFiles('**/CMakeLists.txt', 'include/**') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gcc14-cmake- | |
| - name: Set up build environment | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential cmake ninja-build gcc-14 g++-14 ccache | |
| - name: Set environment variables | |
| run: | | |
| echo "CC=ccache gcc-14" >> $GITHUB_ENV | |
| echo "CXX=ccache g++-14" >> $GITHUB_ENV | |
| echo "CCACHE_DIR=$HOME/.cache/ccache" >> $GITHUB_ENV | |
| echo "CCACHE_COMPILERCHECK=content" >> $GITHUB_ENV | |
| echo "CCACHE_COMPRESS=true" >> $GITHUB_ENV | |
| echo "CCACHE_MAXSIZE=200M" >> $GITHUB_ENV | |
| - name: Setup ccache | |
| run: | | |
| ccache --zero-stats | |
| ccache --show-config | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build \ | |
| -G "Unix Makefiles" \ | |
| -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | |
| -DNFX_DATETIME_BUILD_STATIC=ON \ | |
| -DNFX_DATETIME_BUILD_SHARED=ON \ | |
| -DNFX_DATETIME_BUILD_TESTS=ON \ | |
| -DNFX_DATETIME_BUILD_BENCHMARKS=ON \ | |
| -DNFX_DATETIME_BUILD_SAMPLES=ON \ | |
| -DNFX_DATETIME_BUILD_DOCUMENTATION=OFF | |
| - name: Build | |
| run: cmake --build build --parallel | |
| - name: Test | |
| working-directory: build | |
| run: ctest --output-on-failure --parallel | |
| - name: Show ccache statistics | |
| run: ccache --show-stats |