cmake: add support #35
Workflow file for this run
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
| # Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al. | |
| # | |
| # SPDX-License-Identifier: curl | |
| name: 'Build' | |
| 'on': | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| permissions: {} | |
| jobs: | |
| ubuntu: | |
| name: 'Linux' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| build: | |
| - name: 'default' | |
| install_packages: valgrind | |
| test: test-memory | |
| - name: 'clang sanitizers' | |
| install_packages: clang | |
| test: test | |
| CC: clang | |
| CFLAGS: -fsanitize=address,undefined,signed-integer-overflow -Wformat -Werror=format-security -Werror=array-bounds -g | |
| LDFLAGS: -fsanitize=address,undefined,signed-integer-overflow -g | |
| steps: | |
| - name: 'install prereqs' | |
| env: | |
| MATRIX_PACKAGES: ${{ matrix.build.install_packages }} | |
| run: | | |
| sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list | |
| sudo apt-get -o Dpkg::Use-Pty=0 update | |
| sudo rm -f /var/lib/man-db/auto-update | |
| sudo apt-get -o Dpkg::Use-Pty=0 install \ | |
| libcurl4-openssl-dev ${MATRIX_PACKAGES} | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: 'make' | |
| env: | |
| CC: ${{ matrix.build.CC || 'cc' }} | |
| CFLAGS: ${{ matrix.build.CFLAGS }} | |
| LDFLAGS: ${{ matrix.build.LDFLAGS }} | |
| run: make | |
| - name: 'sanity test' | |
| run: ./trurl -v | |
| - name: 'test' | |
| env: | |
| MATRIX_TEST_TARGET: ${{matrix.build.test}} | |
| run: make ${MATRIX_TEST_TARGET} | |
| cygwin: | |
| name: 'Cygwin' | |
| runs-on: windows-2022 | |
| steps: | |
| - uses: cygwin/cygwin-install-action@f2009323764960f80959895c7bc3bb30210afe4d # v6 | |
| with: | |
| site: https://mirrors.kernel.org/sourceware/cygwin/ | |
| work-vol: 'D:' | |
| packages: libcurl-devel libcurl4 make gcc-core python3 | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: 'make' | |
| run: make | |
| - name: 'sanity test' | |
| run: ./trurl -v | |
| - name: 'test' | |
| run: make test | |
| macos: | |
| name: 'macOS' | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: 'make' | |
| run: make | |
| - name: 'sanity test' | |
| run: ./trurl -v | |
| - name: 'test' | |
| run: make test | |
| - name: 'cmake configure' | |
| run: cmake -B bld -G Ninja -DCMAKE_INSTALL_PREFIX="$HOME"/trurl-install -DTRURL_COMPLETION_ZSH=ON | |
| - name: 'cmake build' | |
| run: cmake --build bld | |
| - name: 'cmake install' | |
| run: cmake --install bld | |
| - name: 'cmake sanity test' | |
| run: bld/trurl -v | |
| - name: 'cmake test' | |
| run: cmake --build bld --target trurl-test | |
| windows: | |
| name: 'Windows' | |
| runs-on: windows-2022 | |
| defaults: | |
| run: | |
| shell: bash | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| persist-credentials: false | |
| - name: 'install prereqs' | |
| run: | | |
| mkdir curl | |
| curl --disable --fail --silent --show-error --connect-timeout 15 --max-time 240 --retry 3 --retry-connrefused \ | |
| --location --proto-redir =https 'https://curl.se/windows/latest.cgi?p=win64-mingw.tar.xz' | tar --strip-components=1 -xJ --directory=curl | |
| - name: 'cmake configure' | |
| run: | | |
| /usr/bin/find curl | |
| echo '-------------------' | |
| pwd | |
| echo '-------------------' | |
| cmake -B bld -DCMAKE_BUILD_TYPE=Debug -DCURL_INCLUDE_DIRS="$PWD"/curl -DCURL_LIBRARY="$PWD"/curl/lib/libcurl.dll.a | |
| - name: 'cmake build' | |
| run: cmake --build bld | |
| - name: 'cmake configure log' | |
| if: ${{ !cancelled() }} | |
| run: cat bld/CMakeFiles/CMake*.yaml 2>/dev/null || true | |
| - name: 'cmake sanity test' | |
| run: | | |
| PATH="$HOME/curl/bin:$PATH" | |
| bld/Debug/trurl -v | |
| - name: 'cmake test' | |
| run: | | |
| PATH="$HOME/curl/bin:$PATH" | |
| cmake --build bld --target trurl-test |