Update cmake-errors.yml #25
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: CMake Errors | |
| on: [push, pull_request] | |
| jobs: | |
| ci-cmake: | |
| name: ${{ matrix.name }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Ubuntu GCC | |
| os: ubuntu-latest | |
| compiler: gcc | |
| cflags: -Werror -Wall -Wextra | |
| # Test out of source builds | |
| - name: Ubuntu GCC OSB | |
| os: ubuntu-latest | |
| compiler: gcc | |
| cflags: -Werror -Wall -Wextra | |
| build-dir: ../build | |
| src-dir: ../mulle-objc-runtime | |
| - name: Ubuntu GCC -O3 | |
| os: ubuntu-latest | |
| compiler: gcc | |
| cflags: -O3 -Werror -Wall -Wextra | |
| - name: Ubuntu Clang | |
| os: ubuntu-latest | |
| compiler: clang | |
| cflags: -Werror -Wall -Wextra | |
| - name: Ubuntu Clang Debug | |
| os: ubuntu-latest | |
| compiler: clang | |
| cflags: -Werror -Wall -Wextra | |
| build-config: Debug | |
| - name: Windows MSVC Win32 | |
| os: windows-latest | |
| compiler: cl | |
| cflags: /WX /W3 | |
| cmake-args: -A Win32 | |
| - name: Windows MSVC Win64 | |
| os: windows-latest | |
| compiler: cl | |
| cflags: /WX /W3 /wd4244 # fixes some warnings in http_parser.c which is not my code | |
| cmake-args: -A x64 | |
| - name: Windows GCC | |
| os: windows-latest | |
| compiler: gcc | |
| cflags: -Werror -Wall -Wextra | |
| cmake-args: -G Ninja | |
| - name: macOS Clang | |
| os: macos-latest | |
| compiler: clang | |
| cflags: -Werror -Wall -Wextra | |
| - name: macOS GCC | |
| os: macos-latest | |
| compiler: gcc-12 | |
| cflags: -Werror -Wall -Wextra | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| # Set installation directory based on OS | |
| - name: Set install directory | |
| id: set-install-dir | |
| shell: bash | |
| run: | | |
| if [ "$RUNNER_OS" == "Windows" ] | |
| then | |
| SRC_DIR="$GITHUB_WORKSPACE\\tmp" | |
| INSTALL_DIR="$GITHUB_WORKSPACE\\usr" | |
| MULLE_CORE_SRC_DIR="$SRC_DIR\\mulle-core" | |
| MULLE_ATINIT_SRC_DIR="$SRC_DIR\\mulle-atinit" | |
| MULLE_ATEXIT_SRC_DIR="$SRC_DIR\\mulle-atexit" | |
| else | |
| SRC_DIR="$GITHUB_WORKSPACE/tmp" | |
| INSTALL_DIR="$GITHUB_WORKSPACE/usr" | |
| MULLE_CORE_SRC_DIR="$SRC_DIR/mulle-core" | |
| MULLE_ATINIT_SRC_DIR="$SRC_DIR/mulle-atinit" | |
| MULLE_ATEXIT_SRC_DIR="$SRC_DIR/mulle-atexit" | |
| fi | |
| echo "INSTALL_DIR=$INSTALL_DIR" >> $GITHUB_OUTPUT | |
| echo "MULLE_CORE_SRC_DIR=$MULLE_CORE_SRC_DIR" >> $GITHUB_OUTPUT | |
| echo "MULLE_ATINIT_SRC_DIR=$MULLE_ATINIT_SRC_DIR" >> $GITHUB_OUTPUT | |
| echo "MULLE_ATEXIT_SRC_DIR=$MULLE_ATEXIT_SRC_DIR" >> $GITHUB_OUTPUT | |
| mkdir -p "$SRC_DIR" | |
| mkdir -p "$INSTALL_DIR" | |
| - name: Clone mulle-core repository | |
| run: | | |
| git clone https://github.com/mulle-core/mulle-core.git "${{steps.set-install-dir.outputs.MULLE_CORE_SRC_DIR}}" | |
| - name: Configure, build and install mulle-core with CMake | |
| working-directory: "${{steps.set-install-dir.outputs.MULLE_CORE_SRC_DIR}}" | |
| run: | | |
| export MULLE_SDK_PATH=${{ steps.set-install-dir.outputs.INSTALL_DIR }} | |
| cmake -B build \ | |
| -DCMAKE_INSTALL_PREFIX=${{ steps.set-install-dir.outputs.INSTALL_DIR }} \ | |
| -DCMAKE_PREFIX_PATH=${{ steps.set-install-dir.outputs.INSTALL_DIR }} \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| cmake --build build --config Release | |
| cmake --install build --config Release | |
| shell: bash | |
| - name: Clone mulle-atinit repository | |
| run: | | |
| git clone https://github.com/mulle-core/mulle-atinit.git "${{steps.set-install-dir.outputs.MULLE_ATINIT_SRC_DIR}}" | |
| - name: Configure, build and install mulle-atinit with CMake | |
| working-directory: "${{steps.set-install-dir.outputs.MULLE_ATINIT_SRC_DIR}}" | |
| run: | | |
| export MULLE_SDK_PATH=${{ steps.set-install-dir.outputs.INSTALL_DIR }} | |
| cmake -B build \ | |
| -DCMAKE_INSTALL_PREFIX=${{ steps.set-install-dir.outputs.INSTALL_DIR }} \ | |
| -DCMAKE_PREFIX_PATH=${{ steps.set-install-dir.outputs.INSTALL_DIR }} \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| cmake --build build --config Release | |
| cmake --install build --config Release | |
| shell: bash | |
| - name: Clone mulle-atexit repository | |
| run: | | |
| git clone https://github.com/mulle-core/mulle-atexit.git "${{steps.set-install-dir.outputs.MULLE_ATEXIT_SRC_DIR}}" | |
| - name: Configure, build and install mulle-atexit with CMake | |
| working-directory: "${{steps.set-install-dir.outputs.MULLE_ATEXIT_SRC_DIR}}" | |
| run: | | |
| export MULLE_SDK_PATH=${{ steps.set-install-dir.outputs.INSTALL_DIR }} | |
| cmake -B build \ | |
| -DCMAKE_INSTALL_PREFIX=${{ steps.set-install-dir.outputs.INSTALL_DIR }} \ | |
| -DCMAKE_PREFIX_PATH=${{ steps.set-install-dir.outputs.INSTALL_DIR }} \ | |
| -DCMAKE_BUILD_TYPE=Release | |
| cmake --build build --config Release | |
| cmake --install build --config Release | |
| shell: bash | |
| - name: Install packages (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| choco install --no-progress ninja ${{ matrix.packages }} | |
| - name: Generate project files | |
| run: | | |
| export MULLE_SDK_PATH=${{ steps.set-install-dir.outputs.INSTALL_DIR }} | |
| cmake -S ${{ matrix.src-dir || '.' }} -B ${{ matrix.build-dir || '.' }} ${{ matrix.cmake-args }} \ | |
| -DCMAKE_BUILD_TYPE=${{ matrix.build-config || 'Release' }} \ | |
| -DCMAKE_PREFIX_PATH=${{ steps.set-install-dir.outputs.INSTALL_DIR }} | |
| env: | |
| CC: ${{ matrix.compiler }} | |
| CFLAGS: ${{ matrix.cflags }} | |
| - name: Compile source code | |
| run: cmake --build ${{ matrix.build-dir || '.' }} --config ${{ matrix.build-config || 'Release' }} |