Skip to content

Commit adc999b

Browse files
committed
ci: rework all actions to use CMake presets
1 parent a585b5c commit adc999b

File tree

10 files changed

+284
-76
lines changed

10 files changed

+284
-76
lines changed

.github/workflows/abi_compliance_check.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,9 @@ jobs:
6262
version: ${{ matrix.qt }}
6363
aqtversion: '==3.1.*'
6464

65-
# Shared Debug
66-
- name: "Shared Debug: Configure"
67-
if: github.event_name == 'pull_request'
68-
run: cmake -G Ninja -S . -B build-shared-dbg -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -Daide_PACKAGING_MAINTAINER_MODE=ON -Daide_ENABLE_ABI_COMPLIANCE_CHECK=ON -Daide_ABI_BASE_HASH=${{ github.event.pull_request.base.sha }}
69-
70-
- name: "Shared Debug: Configure"
71-
if: github.event_name != 'pull_request'
72-
run: cmake -G Ninja -S . -B build-shared-dbg -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON -Daide_PACKAGING_MAINTAINER_MODE=ON -Daide_ENABLE_ABI_COMPLIANCE_CHECK=ON
73-
74-
- name: "Shared Debug: Build"
75-
run: cmake --build build-shared-dbg --parallel
76-
- name: "Shared Debug: ABI compliance check"
77-
run: cmake --build build-shared-dbg --target generate_abi_compliance_report
65+
# Shared Debug with ABI compliance check
66+
- name: "ABI Compliance Check: Workflow"
67+
run: cmake --workflow --preset workflow-ci-abi-check-unix-shared-debug
7868
env:
7969
QT_QPA_PLATFORM: offscreen
8070

@@ -84,5 +74,5 @@ jobs:
8474
with:
8575
name: abi_compliance_report
8676
path: |
87-
build-shared-dbg/compat_reports/libAide/**/*.html
88-
build-shared-dbg/logs/
77+
build-ci-abi-check-unix-shared-debug/compat_reports/libAide/**/*.html
78+
build-ci-abi-check-unix-shared-debug/logs/

.github/workflows/check_licenses.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ jobs:
3535
version: '6.5.0'
3636
aqtversion: '==3.1.*'
3737

38-
- name: Check third party licenses
38+
- name: Setup Ninja
39+
uses: seanmiddleditch/gha-setup-ninja@v5
40+
41+
- name: Install pip dependencies
3942
run: |
40-
mkdir build
41-
cd build
42-
cmake .. -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -DAIDE_CHECK_LICENSES_AVAILABILITY=ON
43+
pip3 install wheel setuptools
44+
pip3 install conan
45+
46+
- name: Check third party licenses
47+
run: cmake --workflow --preset workflow-ci-license-check-unix

.github/workflows/codeql.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ jobs:
4848
version: '6.5.0'
4949
aqtversion: '==3.1.*'
5050

51-
- name: Configure
52-
run: |
53-
mkdir build
54-
cmake -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -Daide_ENABLE_COVERAGE:BOOL=ON -Daide_PACKAGING_MAINTAINER_MODE=ON -DCMAKE_BUILD_TYPE:STRING=Debug -S . -B build
51+
- name: Setup Ninja
52+
uses: seanmiddleditch/gha-setup-ninja@v5
5553

5654
- name: Initialize CodeQL
5755
uses: github/codeql-action/init@v2
@@ -60,8 +58,11 @@ jobs:
6058
languages: ${{ matrix.language }}
6159
queries: +security-and-quality
6260

61+
- name: Configure with preset
62+
run: cmake --preset ci-codeql-unix-debug
63+
6364
- name: Build cpp
64-
run: cmake --build ./build -- -j2
65+
run: cmake --build ./build/ci-codeql-unix-debug -- -j2
6566

6667
- name: Perform CodeQL Analysis
6768
uses: github/codeql-action/analyze@v2

.github/workflows/deploy.yml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- name: Setup cmake
3030
uses: jwlawson/actions-setup-cmake@v2
3131
with:
32-
cmake-version: ${{matrix.cmake}}
32+
cmake-version: 4.x
3333

3434
- name: Print CMake version
3535
run: cmake --version
@@ -44,18 +44,11 @@ jobs:
4444
version: '6.5.0'
4545
aqtversion: '==3.1.*'
4646

47-
48-
- name: Set CMake arguments
49-
id: cmake_args
50-
run: echo "CMAKE_ARGS=-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -DUNIT_TESTS_RUN_ON_CI=1 -DWARNINGS_AS_ERRORS=OFF -Daide_PACKAGING_MAINTAINER_MODE=ON" >> $GITHUB_OUTPUT
51-
52-
# Shared RelWithDebInfo
53-
- name: "Shared Debug: Configure"
54-
run: cmake -G Ninja -S . -B build-shared -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON ${{ steps.cmake_args.outputs.CMAKE_ARGS }}
55-
- name: "Shared Debug: Build"
56-
run: cmake --build build-shared --parallel
57-
- name: "Shared Debug: Test"
58-
run: cmake --build build-shared --target package
47+
# Shared Release with packaging
48+
- name: "Shared Release: Configure and build with preset"
49+
run: cmake --workflow --preset workflow-ci-deploy-unix-shared-release
50+
env:
51+
QT_QPA_PLATFORM: offscreen
5952

6053
- name: Get release
6154
id: get_release
@@ -69,6 +62,6 @@ jobs:
6962
env:
7063
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7164
with:
72-
pattern: "./build-shared/aide*.tar.gz"
65+
pattern: "./build/ci-deploy-unix-shared-release/aide*.tar.gz"
7366
github-token: ${{ secrets.GITHUB_TOKEN }}
7467
release-url: ${{ steps.get_release.outputs.upload_url }}

.github/workflows/doxygen.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,19 @@ jobs:
3737
version: '6.5.0'
3838
aqtversion: '==3.1.*'
3939

40-
4140
- name: Install Doxygen
4241
run:
4342
sudo apt install doxygen graphviz -y
4443

44+
- name: Setup Ninja
45+
uses: seanmiddleditch/gha-setup-ninja@v5
46+
4547
- name: Build doxygen documentation
46-
run: |
47-
mkdir build
48-
cd build
49-
cmake .. -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -DENABLE_DOXYGEN=ON
50-
make doxygen-docs
48+
run: cmake --workflow --preset workflow-ci-doxygen-unix
5149

5250
- name: Publish doxygen documentation to GitHub Pages
5351
uses: peaceiris/actions-gh-pages@v3
5452
with:
55-
publish_dir: build/aide/doc/html
53+
publish_dir: build/ci-doxygen-unix/aide/doc/html
5654
branch: gh_pages
5755
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/install_and_test.yml

Lines changed: 25 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -41,39 +41,36 @@ jobs:
4141
version: ${{ matrix.qt }}
4242
aqtversion: '==3.1.*'
4343

44-
- name: "Static Release: Configure"
45-
working-directory: aide
46-
run: cmake -S . -B build-static-rel -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=../conan_provider.cmake -DCMAKE_BUILD_TYPE=Release -Daide_PACKAGING_MAINTAINER_MODE=ON -DCMAKE_INSTALL_PREFIX=~/.local/build-static-rel/
47-
- name: "Static Release: Build and install"
44+
- name: Setup Ninja
45+
uses: seanmiddleditch/gha-setup-ninja@v5
46+
47+
- name: Setup Python
48+
uses: actions/setup-python@v5
49+
with:
50+
python-version: 3.x
51+
52+
- name: Install pip dependencies
53+
run: |
54+
pip3 install wheel setuptools
55+
pip3 install conan
56+
57+
- name: "Static Release: Workflow lib install"
4858
working-directory: aide
49-
run: cmake --build build-static-rel --target install --parallel
50-
- name: "Static Release: Configure tests"
51-
working-directory: tests
52-
run: cmake -S . -B build-static-rel -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=../conan_provider.cmake -Daide_PACKAGING_MAINTAINER_MODE=ON -DCMAKE_INSTALL_PREFIX=~/.local/build-static-rel -DUNIT_TESTS_RUN_ON_CI=1
53-
- name: "Static Release: Build tests"
59+
run: cmake --workflow --preset workflow-ci-install-lib-unix-static-release
60+
61+
- name: "Static Release: Workflow test installed lib"
5462
working-directory: tests
55-
run: cmake --build build-static-rel --parallel
56-
- name: "Static Release: Run tests"
57-
working-directory: tests/build-static-rel
58-
run: ctest
63+
run: cmake --workflow --preset workflow-ci-install-test-unix-static-release
5964
env:
6065
QT_QPA_PLATFORM: offscreen
6166

62-
- name: "Shared Release: Configure"
67+
- name: "Shared Release: Workflow lib install"
6368
working-directory: aide
64-
run: cmake -S . -B build-shared-rel -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=../conan_provider.cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -Daide_PACKAGING_MAINTAINER_MODE=ON -DCMAKE_INSTALL_PREFIX=~/.local/build-shared-rel/
65-
- name: "Shared Release: Build and install"
66-
working-directory: aide
67-
run: cmake --build build-shared-rel --target install --parallel
68-
- name: "Shared Release: Configure tests"
69-
working-directory: tests
70-
run: cmake -S . -B build-shared-rel -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=../conan_provider.cmake -DCMAKE_INSTALL_PREFIX=~/.local/build-shared-rel -Daide_PACKAGING_MAINTAINER_MODE=ON -DUNIT_TESTS_RUN_ON_CI=1
71-
- name: "Shared Release: Build tests"
69+
run: cmake --workflow --preset workflow-ci-install-lib-unix-shared-release
70+
71+
- name: "Shared Release: Test installed lib"
7272
working-directory: tests
73-
run: LD_LIBRARY_PATH=~/.local/build-shared-rel/lib cmake --build build-shared-rel --parallel
74-
- name: "Shared Release: Run tests"
75-
working-directory: tests/build-shared-rel
76-
run: LD_LIBRARY_PATH=~/.local/build-shared-rel/lib ctest --output-on-failure
73+
run: cmake --workflow --preset workflow-ci-install-test-unix-shared-release
7774
env:
7875
QT_QPA_PLATFORM: offscreen
7976

@@ -82,7 +79,7 @@ jobs:
8279
uses: actions/upload-artifact@v4
8380
with:
8481
name: test_results_installed_lib-qt-${{ matrix.qt }}
85-
path: tests/build*rel/**/*.xml
82+
path: tests/build*/**/*.xml
8683

8784
publish-test-results:
8885
name: "Publish Unit Test Results from installed lib"
@@ -102,6 +99,6 @@ jobs:
10299
check_name: Unit Test Results install lib
103100
hide_comments: all but latest
104101
comment_on_pr: true
105-
files: artifacts/test_results_installed_lib/build*rel/**/*.xml
102+
files: artifacts/test_results_installed_lib/build*/**/*.xml
106103
report_individual_runs: true
107104
deduplicate_classes_by_file_name: false

CMakePresets.json

Lines changed: 73 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"name": "base",
1313
"hidden": true,
1414
"binaryDir": "${sourceDir}/build/${presetName}",
15-
"installDir": "${sourceDir}/install/${presetName}",
15+
"installDir": "${sourceDir}/build/install/${presetName}",
1616
"cacheVariables": {
1717
"CMAKE_PROJECT_TOP_LEVEL_INCLUDES": "${sourceDir}/conan_provider.cmake",
1818
"CMAKE_FIND_PACKAGE_PREFER_CONFIG": "TRUE",
@@ -160,6 +160,28 @@
160160
{ "name": "ci-static-unix-shared-debug", "inherits": ["clang","shared","debug","role-ci-static", "platform-unix"] },
161161
{ "name": "ci-static-unix-shared-release", "inherits": ["clang","shared","release","role-ci-static", "platform-unix"] },
162162

163+
{ "name": "abi-check", "hidden": true,
164+
"cacheVariables": { "aide_ENABLE_ABI_COMPLIANCE_CHECK": "ON" }
165+
},
166+
167+
{ "name": "codeql", "hidden": true,
168+
"cacheVariables": { "aide_ENABLE_COVERAGE": "ON" }
169+
},
170+
171+
{ "name": "doxygen", "hidden": true,
172+
"cacheVariables": { "ENABLE_DOXYGEN": "ON" }
173+
},
174+
175+
{ "name": "ci-abi-check-unix-shared-debug", "inherits": ["clang","shared","debug","abi-check", "platform-unix"], "cacheVariables": { "CMAKE_DEBUG_POSTFIX": "_d" } },
176+
177+
{ "name": "ci-codeql-unix-debug", "inherits": ["clang","static","debug","codeql", "platform-unix"] },
178+
179+
{ "name": "ci-doxygen-unix", "inherits": ["clang","static","release","doxygen", "platform-unix"] },
180+
181+
{ "name": "ci-license-check-unix", "inherits": ["clang","static","release", "platform-unix"], "cacheVariables": { "AIDE_CHECK_LICENSES_AVAILABILITY": "ON" } },
182+
183+
{ "name": "ci-deploy-unix-shared-release", "inherits": ["clang","shared","release", "test-on-ci", "platform-unix"], "cacheVariables": { "aide_PACKAGING_MAINTAINER_MODE": "ON" } },
184+
163185
{ "name": "dev-windows-static", "inherits": ["static","role-dev", "platform-windows"] },
164186
{ "name": "dev-windows-shared", "inherits": ["shared","role-dev", "platform-windows"] },
165187

@@ -196,6 +218,14 @@
196218
{ "name": "build-ci-static-unix-shared-debug", "configurePreset": "ci-static-unix-shared-debug", "jobs": 0 },
197219
{ "name": "build-ci-static-unix-shared-release", "configurePreset": "ci-static-unix-shared-release", "jobs": 0 },
198220

221+
{ "name": "build-ci-abi-check-unix-shared-debug", "configurePreset": "ci-abi-check-unix-shared-debug", "jobs": 0 },
222+
223+
{ "name": "build-ci-codeql-unix-debug", "configurePreset": "ci-codeql-unix-debug", "jobs": 0 },
224+
225+
{ "name": "build-ci-doxygen-unix", "configurePreset": "ci-doxygen-unix", "jobs": 0, "targets": ["doxygen-docs"] },
226+
227+
{ "name": "build-ci-deploy-unix-shared-release", "configurePreset": "ci-deploy-unix-shared-release", "jobs": 0, "targets": ["package"] },
228+
199229
{ "name": "build-dev-windows-static-debug", "configurePreset": "dev-windows-static", "configuration": "Debug" },
200230
{ "name": "build-dev-windows-shared-debug", "configurePreset": "dev-windows-shared", "configuration": "Debug" },
201231

@@ -252,6 +282,8 @@
252282
{ "name": "test-ci-static-unix-shared-debug", "inherits": "test-common", "configurePreset": "ci-static-unix-shared-debug" },
253283
{ "name": "test-ci-static-unix-shared-release", "inherits": "test-common", "configurePreset": "ci-static-unix-shared-release" },
254284

285+
{ "name": "test-ci-abi-check-unix-shared-debug", "inherits": "test-common", "configurePreset": "ci-abi-check-unix-shared-debug" },
286+
255287
{ "name": "test-dev-windows-static-debug", "inherits": "test-common", "configurePreset": "dev-windows-static", "configuration": "Debug" },
256288
{ "name": "test-dev-windows-shared-debug", "inherits": "test-common", "configurePreset": "dev-windows-shared", "configuration": "Debug" },
257289

@@ -460,8 +492,47 @@
460492
{ "type": "build", "name": "build-ci-coverage-unix" },
461493
{ "type": "test", "name": "test-ci-coverage-unix" }
462494
]
463-
}
495+
},
496+
497+
{
498+
"name": "workflow-ci-abi-check-unix-shared-debug",
499+
"steps": [
500+
{ "type": "configure", "name": "ci-abi-check-unix-shared-debug" },
501+
{ "type": "build", "name": "build-ci-abi-check-unix-shared-debug" },
502+
{ "type": "test", "name": "test-ci-abi-check-unix-shared-debug" }
503+
]
504+
},
464505

506+
{
507+
"name": "workflow-ci-codeql-unix-debug",
508+
"steps": [
509+
{ "type": "configure", "name": "ci-codeql-unix-debug" },
510+
{ "type": "build", "name": "build-ci-codeql-unix-debug" }
511+
]
512+
},
513+
514+
{
515+
"name": "workflow-ci-doxygen-unix",
516+
"steps": [
517+
{ "type": "configure", "name": "ci-doxygen-unix" },
518+
{ "type": "build", "name": "build-ci-doxygen-unix" }
519+
]
520+
},
521+
522+
{
523+
"name": "workflow-ci-license-check-unix",
524+
"steps": [
525+
{ "type": "configure", "name": "ci-license-check-unix" }
526+
]
527+
},
528+
529+
{
530+
"name": "workflow-ci-deploy-unix-shared-release",
531+
"steps": [
532+
{ "type": "configure", "name": "ci-deploy-unix-shared-release" },
533+
{ "type": "build", "name": "build-ci-deploy-unix-shared-release" }
534+
]
535+
}
465536

466537
]
467538
}

0 commit comments

Comments
 (0)