Fix MSVC CMake flag quoting #5
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: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| jobs: | |
| linux: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - cc: gcc | |
| c_standard: 99 | |
| - cc: gcc | |
| c_standard: 11 | |
| - cc: clang | |
| c_standard: 99 | |
| - cc: clang | |
| c_standard: 11 | |
| steps: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
| - name: Configure | |
| run: cmake -S . -B build -DMICROTIMER_BUILD_TESTS=ON -DCMAKE_C_COMPILER=${{ matrix.cc }} -DCMAKE_C_STANDARD=${{ matrix.c_standard }} | |
| - name: Build | |
| run: cmake --build build | |
| - name: Test | |
| run: ctest --test-dir build --output-on-failure | |
| linux-sanitizers: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| sanitize: | |
| - address | |
| - undefined | |
| - address,undefined | |
| steps: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
| - name: Configure | |
| run: cmake -S . -B build -DMICROTIMER_BUILD_TESTS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_C_FLAGS="-fsanitize=${{ matrix.sanitize }} -fno-omit-frame-pointer" | |
| - name: Build | |
| run: cmake --build build | |
| - name: Test | |
| run: ctest --test-dir build --output-on-failure | |
| linux-analysis: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
| - name: Install optional tools | |
| run: sudo apt-get update && sudo apt-get install -y clang-tidy cppcheck clang-tools | |
| - name: Strict configure | |
| run: cmake -S . -B build -DMICROTIMER_BUILD_TESTS=ON -DCMAKE_C_COMPILER=clang -DCMAKE_C_FLAGS="-Wconversion -Wsign-conversion -fshort-enums" | |
| - name: Build | |
| run: cmake --build build | |
| - name: Clang static analyzer | |
| run: scan-build --status-bugs cmake --build build | |
| - name: Clang tidy | |
| run: clang-tidy src/mtimer.c -- -Iinclude | |
| - name: Cppcheck | |
| run: cppcheck --enable=warning,style,performance --error-exitcode=1 include src tests | |
| windows-msvc: | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
| - name: Configure, build, and test with MSVC | |
| shell: pwsh | |
| run: | | |
| $vswhere = Join-Path ${env:ProgramFiles(x86)} "Microsoft Visual Studio\Installer\vswhere.exe" | |
| $installationPath = & $vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath | |
| if (-not $installationPath) { | |
| throw "No Visual Studio installation with MSVC tools was found." | |
| } | |
| $devCmd = Join-Path $installationPath "Common7\Tools\VsDevCmd.bat" | |
| $command = "`"$devCmd`" -arch=x64 && cmake -S . -B build -G Ninja -DMICROTIMER_BUILD_TESTS=ON -DCMAKE_C_COMPILER=cl -DCMAKE_C_FLAGS:STRING=`"/W4 /WX`" && cmake --build build && ctest --test-dir build --output-on-failure" | |
| cmd /c $command | |
| install-consumers: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
| - name: Install package | |
| run: cmake -S . -B build -DCMAKE_INSTALL_PREFIX="$PWD/stage" && cmake --build build && cmake --install build | |
| - name: find_package consumer | |
| run: cmake -S tests/find_package_consumer -B build-find -DCMAKE_PREFIX_PATH="$PWD/stage" && cmake --build build-find | |
| - name: add_subdirectory consumer | |
| run: cmake -S tests/add_subdirectory_consumer -B build-subdir && cmake --build build-subdir | |
| arm-cross: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| cpu: | |
| - cortex-m0 | |
| - cortex-m0plus | |
| - cortex-m4 | |
| steps: | |
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 | |
| - name: Install ARM toolchain | |
| run: sudo apt-get update && sudo apt-get install -y gcc-arm-none-eabi | |
| - name: Compile only | |
| run: arm-none-eabi-gcc -std=c99 -Wall -Wextra -Werror -mcpu=${{ matrix.cpu }} -mthumb -Iinclude -c src/mtimer.c -o mtimer-${{ matrix.cpu }}.o |