Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Use CMakePresets for MacOS CI #807

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,17 @@ jobs:
shell: bash
run: brew install ninja popt

- name: Configure Build & Test
- name: Configure
shell: bash
run: cmake --preset ci-macos

- name: Build
shell: bash
run: cmake --build --preset ci-macos

- name: Test
shell: bash
run: ./travis.sh macos
run: ctest --preset ci-macos

build-win32:
runs-on: windows-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/libtool
/ltmain.sh
/missing
/out
/stamp-h1
/test-suite.log
INSTALL
Expand Down
43 changes: 43 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 22,
"patch": 0
},
"configurePresets": [
{
"name": "ci-macos",
"displayName": "Continuous integration for MacOS",
"generator": "Ninja",
"binaryDir": "${sourceDir}/out/build/${presetName}",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
"CMAKE_C_FLAGS": "-Wall -Wextra -Wstrict-prototypes -Wno-unused-function -Werror",
"OPENSSL_ROOT_DIR": "/usr/local/opt/[email protected]",
"BUILD_EXAMPLES": "ON",
"BUILD_TESTING": "ON",
"BUILD_TOOLS": "ON"
}
}
],
"buildPresets": [
{
"name": "ci-macos",
"description": "",
"displayName": "",
"configurePreset": "ci-macos",
"targets": [
"install"
]
}
],
"testPresets": [
{
"name": "ci-macos",
"description": "",
"displayName": "",
"configurePreset": "ci-macos"
}
]
}
10 changes: 1 addition & 9 deletions travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,6 @@ build_framing() {
ctest -V .
}

build_macos() {
mkdir $PWD/_build && cd $PWD/_build
cmake .. -GNinja -DBUILD_EXAMPLES=ON -DBUILD_TOOLS=ON -DCMAKE_INSTALL_PREFIX=$PWD/../_install -DCMAKE_C_FLAGS="-Wall -Wextra -Wstrict-prototypes -Wno-unused-function -Werror" \
-DOPENSSL_ROOT_DIR="/usr/local/opt/[email protected]"
cmake --build . --target install
ctest -V .
}

build_format() {
sudo apt-get install -y clang-format
./travis/run-clang-format/run-clang-format.py \
Expand Down Expand Up @@ -73,7 +65,7 @@ build_scan-build() {
}

if [ "$#" -ne 1 ]; then
echo "Usage: $0 {cmake|framing|macos|format|coverage|asan|tsan|scan-build}"
echo "Usage: $0 {cmake|framing|format|coverage|asan|tsan|scan-build}"
exit 1
fi

Expand Down
Loading