mirror of
https://github.com/curl/curl.git
synced 2026-06-22 06:35:39 +03:00
cmake: add integration tests, run them in CI
Add CMake test project consuming curl via these methods: `FetchContent`, `add_subdirectory()`, `find_package()`. Also: - GHA/distcheck: run these tests in CI. - cmakelint: exclude a warning for calling "wonky-cased" built-in CMake functions, such as `FetchContent_Declare()`. Closes #16126
This commit is contained in:
parent
2b9b3ec579
commit
fb70812437
9 changed files with 197 additions and 5 deletions
2
.github/workflows/configure-vs-cmake.yml
vendored
2
.github/workflows/configure-vs-cmake.yml
vendored
|
|
@ -13,6 +13,7 @@ name: configure-vs-cmake
|
|||
- '**/CMakeLists.txt'
|
||||
- 'CMake/**'
|
||||
- 'lib/curl_config.h.cmake'
|
||||
- 'tests/cmake/**'
|
||||
- '.github/scripts/cmp-config.pl'
|
||||
- '.github/workflows/configure-vs-cmake.yml'
|
||||
|
||||
|
|
@ -25,6 +26,7 @@ name: configure-vs-cmake
|
|||
- '**/CMakeLists.txt'
|
||||
- 'CMake/**'
|
||||
- 'lib/curl_config.h.cmake'
|
||||
- 'tests/cmake/**'
|
||||
- '.github/scripts/cmp-config.pl'
|
||||
- '.github/workflows/configure-vs-cmake.yml'
|
||||
|
||||
|
|
|
|||
30
.github/workflows/distcheck.yml
vendored
30
.github/workflows/distcheck.yml
vendored
|
|
@ -159,3 +159,33 @@ jobs:
|
|||
mv curl-9.10.11.tar.gz _verify
|
||||
cd _verify
|
||||
../scripts/verify-release curl-9.10.11.tar.gz
|
||||
|
||||
cmake-integration:
|
||||
name: 'cmake-integration-on-${{ matrix.image }}'
|
||||
runs-on: ${{ matrix.image }}
|
||||
timeout-minutes: 10
|
||||
env:
|
||||
CC: clang
|
||||
CMAKE_GENERATOR: Ninja
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: [ubuntu-latest, macos-latest]
|
||||
steps:
|
||||
- name: 'install prereqs'
|
||||
run: |
|
||||
if [[ '${{ matrix.image }}' = *'ubuntu'* ]]; then
|
||||
sudo apt-get -o Dpkg::Use-Pty=0 install ninja-build libpsl-dev libssl-dev
|
||||
else
|
||||
brew install ninja libpsl openssl
|
||||
fi
|
||||
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
- name: 'via FetchContent'
|
||||
run: ./tests/cmake/test.sh FetchContent
|
||||
- name: 'via add_subdirectory'
|
||||
run: ./tests/cmake/test.sh add_subdirectory
|
||||
- name: 'via find_package'
|
||||
run: ./tests/cmake/test.sh find_package
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue