Skip to content

Commit 1dffc21

Browse files
committed
simplified cmake test runs using scripts and docker (4)
* simplified names of cmake presets * removed unused cmake folder
1 parent ef3322e commit 1dffc21

15 files changed

+250
-209
lines changed

.github/workflows/cmake_tests.yml

Lines changed: 30 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3,102 +3,57 @@ name: CMake-Tests
33
on: push
44

55
jobs:
6-
windows-msvc:
7-
name: "Windows MSVC"
8-
runs-on: windows-latest
9-
10-
steps:
11-
- name: Checkout
12-
uses: actions/checkout@v2
13-
14-
- name: Install Tools Ninja and mvsc
15-
uses: ilammy/msvc-dev-cmd@v1
16-
- uses: seanmiddleditch/gha-setup-ninja@master
17-
18-
- name: Config
19-
run: cmake -S . --preset Windows-MSVC
20-
21-
- name: Build
22-
run: |
23-
cmake --build --preset Windows-MSVC-Debug
24-
cmake --build --preset Windows-MSVC-Release
25-
26-
- name: Test
27-
run: |
28-
ctest --preset Test-Windows-MSVC-Debug
29-
ctest --preset Test-Windows-MSVC-Release
30-
31-
32-
linux-clang:
33-
name: "Linux Clang"
34-
runs-on: ubuntu-latest
6+
windows:
7+
name: "Windows"
8+
runs-on: windows-2019
359

3610
strategy:
3711
fail-fast: false
3812
matrix:
3913
include:
40-
- clang_major: 12
41-
- clang_major: 13
14+
- preset: "msvc2019"
4215

4316
steps:
4417
- name: Checkout
4518
uses: actions/checkout@v2
4619

47-
- name: Install Ninja
48-
uses: seanmiddleditch/gha-setup-ninja@master
49-
50-
- name: Install clang ${{ matrix.clang_major }}
51-
run: |
52-
sudo apt-get update
53-
sudo apt-get install clang-${{ matrix.clang_major }} libc++1-${{ matrix.clang_major }} libc++-${{ matrix.clang_major }}-dev libc++abi-${{ matrix.clang_major }}-dev libc++abi1-${{ matrix.clang_major }}
54-
55-
- name: Config
56-
run: |
57-
cmake -S . --preset Linux-Clang
58-
59-
- name: Build
60-
run: |
61-
cmake --build --preset Linux-Clang-Debug
62-
cmake --build --preset Linux-Clang-Release
20+
- name: Install Tools Ninja and mvsc
21+
uses: ilammy/msvc-dev-cmd@v1
22+
- uses: seanmiddleditch/gha-setup-ninja@master
6323

64-
- name: Test
65-
run: |
66-
ctest --preset Test-Linux-Clang-Debug
67-
ctest --preset Test-Linux-Clang-Release
24+
- name: Build and Test Debug
25+
run: script/test_cmake.bat ${{ matrix.preset }} debug
6826

27+
- name: Build and Test Release
28+
run: script/test_cmake.bat ${{ matrix.preset }} release
6929

70-
linux-gcc:
71-
name: "Linux GCC"
30+
linux:
31+
name: "Linux"
7232
runs-on: ubuntu-latest
7333

7434
strategy:
7535
fail-fast: false
7636
matrix:
7737
include:
78-
- gcc_major: 11
38+
- image: "arbmind/cmake-clang12:latest"
39+
preset: "clang"
40+
- image: "arbmind/cmake-clang13:latest"
41+
preset: "clang"
42+
- image: "arbmind/cmake-gcc11:latest"
43+
preset: "gcc"
7944

8045
steps:
8146
- name: Checkout
8247
uses: actions/checkout@v2
8348

84-
- name: Install Ninja
85-
uses: seanmiddleditch/gha-setup-ninja@master
86-
87-
- name: Install gcc ${{ matrix.gcc_major }}
88-
run: |
89-
sudo apt-get update
90-
sudo apt-get install gcc-${{ matrix.gcc_major }} g++-${{ matrix.gcc_major }} libstdc++-${{ matrix.gcc_major }}-dev
91-
92-
- name: Config
93-
run: |
94-
cmake -S . --preset Linux-Gcc
95-
96-
- name: Build
97-
run: |
98-
cmake --build --preset Linux-Gcc-Debug
99-
cmake --build --preset Linux-Gcc-Release
100-
101-
- name: Test
102-
run: |
103-
ctest --preset Test-Linux-Gcc-Debug
104-
ctest --preset Test-Linux-Gcc-Release
49+
- name: Build and Test Debug
50+
run: >-
51+
docker run --rm -v ${GITHUB_WORKSPACE}:/project -w /project
52+
${{ matrix.image }}
53+
script/test_cmake.sh ${{ matrix.preset }} debug
54+
55+
- name: Build and Test Release
56+
run: >-
57+
docker run --rm -v ${GITHUB_WORKSPACE}:/project -w /project
58+
${{ matrix.image }}
59+
script/test_cmake.sh ${{ matrix.preset }} release

.github/workflows/qbs_tests.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@ name: Qbs-Tests
33
on: push
44

55
jobs:
6-
docker-qbs:
7-
name: "Build and run tests on Docker"
6+
linux:
7+
name: "Linux"
8+
runs-on: ubuntu-latest
9+
810
strategy:
911
fail-fast: false
1012
matrix:
@@ -13,36 +15,47 @@ jobs:
1315
- image: arbmind/qbs-clang11:qbs_v1.20.1
1416
- image: arbmind/qbs-clang12:qbs_v1.20.1
1517
- image: arbmind/qbs-gcc11:qbs_v1.20.1
16-
runs-on: ubuntu-latest
18+
1719
steps:
1820
- uses: actions/checkout@v2
1921

20-
- name: get googletest
22+
- name: Get Googletest
2123
run: third_party/git_clone_googletest.sh
2224

23-
- name: run qbs build
25+
- name: Build and run Tests
2426
run: >-
2527
docker run --rm -v ${GITHUB_WORKSPACE}:/build -w /build
2628
${{ matrix.image }}
2729
build
2830
--build-directory /tmp/build
2931
-p autotest-runner
3032
31-
windows-qbs:
32-
name: "Build and run tests on Windows"
33+
windows:
34+
name: "Windows"
3335
runs-on: windows-2019
36+
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
include:
41+
- profile: MSVC2019-x64
42+
3443
steps:
35-
- run: choco install qbs
36-
- run: qbs setup-toolchains --detect
37-
- run: qbs config --list profiles
44+
- name: Install Qbs
45+
run: choco install qbs
46+
- name: Setup Qbs
47+
run: |
48+
qbs setup-toolchains --detect
49+
qbs config --list profiles
3850
3951
- uses: actions/checkout@v2
4052

41-
- name: get googletest
53+
- name: Get Googletest
4254
run: third_party/git_clone_googletest.sh
4355
shell: bash
4456

45-
- run: >-
46-
qbs build profile:MSVC2019-x64
57+
- name: Build and run Tests
58+
run: >-
59+
qbs build profile:${{ matrix.profile }}
4760
--build-directory ${env:RUNNER_TEMP}\build
4861
-p autotest-runner
Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
name: Static Analyse
1+
name: Static Analyzer
22

33
on: push
44

55
jobs:
6-
Clang-Static-Analyse:
7-
name: "Linux-Clang-Static-Analyse"
6+
clang-analyze:
7+
name: "Clang Static Analyzer"
88
runs-on: ubuntu-latest
9-
9+
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
include:
14+
- image: arbmind/cmake-clang12:latest
15+
preset: clang-analyze
16+
1017
steps:
1118
- name: Checkout
1219
uses: actions/checkout@v2
1320

14-
- name: Install Ninja
15-
uses: seanmiddleditch/gha-setup-ninja@master
16-
17-
- name: Install clang 12
18-
run: |
19-
sudo apt-get update
20-
sudo apt-get install clang-12 llvm-12
21-
22-
- name: Config
23-
run: |
24-
cmake -S . --preset Clang-Static-Analyser
25-
26-
- name: Build
27-
run: |
28-
cmake --build --preset Clang-Static-Analyser
21+
- name: Build and Analyze
22+
run: >-
23+
docker run --rm -v ${GITHUB_WORKSPACE}:/project -w /project
24+
${{ matrix.image }}
25+
script/build_cmake.sh ${{ matrix.preset }} debug

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ thirdparty/*/
99
.vagrant/
1010
.vscode/
1111
.vs/
12+
build/
1213
CMakeUserPresets.json

CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ set(CMAKE_CXX_STANDARD 20)
55

66
option(co-cpp19-enable-tests "Build the tests" OFF)
77
add_subdirectory(third_party)
8-
add_subdirectory(cmake)
98
if(${co-cpp19-enable-tests})
10-
enable_testing()
9+
enable_testing()
1110
endif()
1211

1312
add_subdirectory(src/)

0 commit comments

Comments
 (0)