name: CMake on: push: branches: - master - 'release-*' pull_request: # run on all pr jobs: build: strategy: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] shared: ["ON", "OFF"] runs-on: ${{ matrix.os }} name: ${{ matrix.os }} - shared=${{ matrix.shared }} steps: - uses: actions/checkout@v6 - name: Build run: | mkdir build cmake -S . -B build -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DUTF8PROC_ENABLE_TESTING=ON -DCMAKE_INSTALL_PREFIX=tmp/install cmake --build build - name: Run Test run: ctest --test-dir build -V - name: Upload shared lib if: matrix.shared == 'ON' uses: actions/upload-artifact@v6 with: name: ${{ matrix.os }} path: | build/libutf8proc.* build/Debug/utf8proc.* - name: Test Consuming (Windows) if: runner.os == 'Windows' run: | cmake --install build --config Debug cmake -S test/app -B test/app/build -DCMAKE_INSTALL_PREFIX=tmp/install cmake --build test/app/build $Env:PATH = "$PWD\tmp\install\bin;$Env:PATH" test/app/build/Debug/app.exe - name: Test Consuming (Unix) if: runner.os != 'Windows' run: | cmake --install build cmake -S test/app -B test/app/build -DCMAKE_INSTALL_PREFIX=tmp/install cmake --build test/app/build test/app/build/app mingw: strategy: matrix: os: [windows-latest] shared: ["ON", "OFF"] runs-on: ${{ matrix.os }} name: mingw64 - shared=${{ matrix.shared }} defaults: run: shell: msys2 {0} steps: - uses: actions/checkout@v6 - uses: msys2/setup-msys2@v2 with: install: gcc make mingw-w64-x86_64-cmake - name: Build run: | mkdir build cmake -S . -B build -DBUILD_SHARED_LIBS=${{ matrix.shared }} -DUTF8PROC_ENABLE_TESTING=ON -G'MSYS Makefiles' -DCMAKE_INSTALL_PREFIX=tmp/install cmake --build build - name: Run Test run: ctest --test-dir build -V - name: Upload shared lib if: matrix.shared == 'ON' uses: actions/upload-artifact@v6 with: name: windows-mingw64 path: build/libutf8proc.* - name: Test Consuming run: | cmake --install build cmake -S test/app -B test/app/build -DCMAKE_INSTALL_PREFIX=tmp/install -G'MSYS Makefiles' cmake --build test/app/build PATH="$(pwd)/tmp/install/bin:$PATH" test/app/build/app.exe