name: CMake on multiple platforms on: push: branches: [ "master" ] pull_request: branches: [ "master" ] jobs: build-windows: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [windows-latest] build_type: [RelWithDebInfo] sys: - mingw64 name: ${{ matrix.sys }} defaults: run: shell: msys2 {0} steps: - name: 'Checkout' uses: actions/checkout@v4 - name: 'Setup MSYS2 ${{ matrix.sys }}' uses: msys2/setup-msys2@v2 with: msystem: ${{matrix.sys}} install: >- git make pacboy: >- toolchain:p cmake:p libxml2:p libcurl:p - name: 'Build' run: | cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} cmake --build build build-nix: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] build_type: [RelWithDebInfo] c_compiler: [gcc, clang] include: - os: macos-latest c_compiler: clang - os: ubuntu-latest c_compiler: gcc - os: ubuntu-latest c_compiler: clang exclude: - os: macos-latest c_compiler: gcc steps: - uses: actions/checkout@v4 - name: Set reusable strings id: strings shell: bash run: | echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" - name: Install Linux dependencies if: matrix.os == 'ubuntu-latest' run: > sudo apt install -y libcurl4-openssl-dev libxml2-dev rsync - name: Configure CMake run: > cmake -B ${{ steps.strings.outputs.build-output-dir }} -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -S ${{ github.workspace }} - name: Build run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} # TODO: Write ctests #- name: Test # working-directory: ${{ steps.strings.outputs.build-output-dir }} # run: ctest --build-config ${{ matrix.build_type }}