Skip to content

Commit c3cef3f

Browse files
committed
Add CMake CI
- Based on Docker for environment and Make for orchestration - Add amd64 docker cmake based build workflows
1 parent ac4a849 commit c3cef3f

File tree

17 files changed

+853
-0
lines changed

17 files changed

+853
-0
lines changed

.dockerignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Project Files unneeded by docker
2+
ci/cache
3+
ci/docker
4+
.coin-or
5+
.git
6+
.gitignore
7+
.github
8+
.dockerignore
9+
.clang-format
10+
AUTHORS
11+
INSTALL
12+
install-sh
13+
missing
14+
README.md
15+
16+
build/
17+
18+
# Editor directories and files
19+
*.user
20+
*.swp

.github/workflows/amd64_docker.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# ref: https://github.com/docker-library/official-images
2+
name: amd64 Docker
3+
4+
on: [push, pull_request, workflow_dispatch]
5+
6+
jobs:
7+
docker:
8+
strategy:
9+
matrix:
10+
distro: [
11+
almalinux,
12+
alpine,
13+
archlinux,
14+
debian,
15+
fedora,
16+
opensuse,
17+
rockylinux,
18+
ubuntu
19+
]
20+
fail-fast: false
21+
name: amd64 • ${{ matrix.distro }}
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Check docker
26+
run: |
27+
docker info
28+
docker buildx ls
29+
- name: Build env image
30+
run: make --directory=ci amd64_${{ matrix.distro }}_env
31+
- name: Build devel project
32+
run: make --directory=ci amd64_${{ matrix.distro }}_devel
33+
- name: Build project
34+
run: make --directory=ci amd64_${{ matrix.distro }}_build
35+
- name: Test project
36+
run: make --directory=ci amd64_${{ matrix.distro }}_test
37+
38+
- name: Build install env image
39+
run: make --directory=ci amd64_${{ matrix.distro }}_install_env
40+
- name: Build install devel project
41+
run: make --directory=ci amd64_${{ matrix.distro }}_install_devel
42+
- name: Build install project
43+
run: make --directory=ci amd64_${{ matrix.distro }}_install_build
44+
- name: Test install project
45+
run: make --directory=ci amd64_${{ matrix.distro }}_install_test

.github/workflows/amd64_linux.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# ref: https://github.com/actions/runner-images
2+
name: amd64 Linux
3+
4+
on: [push, pull_request, workflow_dispatch]
5+
6+
# Building using the github runner environement directly.
7+
jobs:
8+
native:
9+
strategy:
10+
matrix:
11+
cmake: [
12+
{generator: "Unix Makefiles", config: "Release"},
13+
{generator: "Ninja", config: "Release"},
14+
{generator: "Ninja Multi-Config", config: "Release"},
15+
]
16+
fail-fast: false
17+
name: Linux • ${{ matrix.cmake.generator }}
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Install Ninja
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install ninja-build
25+
- name: Check cmake
26+
run: cmake --version
27+
- name: Configure
28+
run: >
29+
cmake -S. -Bbuild
30+
-G "${{ matrix.cmake.generator }}"
31+
-DCMAKE_BUILD_TYPE="$BUILD_TYPE"
32+
-DCMAKE_INSTALL_PREFIX=install
33+
- name: Build
34+
run: >
35+
cmake --build build
36+
--config ${{ matrix.cmake.config }}
37+
--target all
38+
-v -j2
39+
- name: Test
40+
run: >
41+
CTEST_OUTPUT_ON_FAILURE=1
42+
cmake --build build
43+
--config ${{ matrix.cmake.config }}
44+
--target test
45+
-v
46+
- name: Install
47+
run: >
48+
cmake --build build
49+
--config ${{ matrix.cmake.config }}
50+
--target install
51+
-v

.github/workflows/amd64_macos.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ref: https://github.com/actions/runner-images
2+
name: amd64 MacOS
3+
4+
on: [push, pull_request, workflow_dispatch]
5+
6+
# Building using the github runner environement directly.
7+
jobs:
8+
native:
9+
strategy:
10+
matrix:
11+
cmake: [
12+
{generator: "Xcode", config: Release, build_target: ALL_BUILD, test_target: RUN_TESTS, install_target: install},
13+
{generator: "Unix Makefiles", config: Release, build_target: all, test_target: test, install_target: install},
14+
]
15+
fail-fast: false
16+
name: MacOS • ${{ matrix.cmake.generator }}
17+
runs-on: macos-13 # last macos intel based runner
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Check cmake
21+
run: cmake --version
22+
- name: Configure
23+
run: >
24+
cmake -S. -Bbuild
25+
-G "${{ matrix.cmake.generator }}"
26+
-DCMAKE_BUILD_TYPE=${{ matrix.cmake.config }}
27+
-DCMAKE_INSTALL_PREFIX=install
28+
- name: Build
29+
run: >
30+
cmake --build build
31+
--config ${{ matrix.cmake.config }}
32+
--target ${{ matrix.cmake.build_target }}
33+
-v -j2
34+
- name: Test
35+
run: >
36+
CTEST_OUTPUT_ON_FAILURE=1
37+
cmake --build build
38+
--config ${{ matrix.cmake.config }}
39+
--target ${{ matrix.cmake.test_target }}
40+
-v
41+
- name: Install
42+
run: >
43+
cmake --build build
44+
--config ${{ matrix.cmake.config }}
45+
--target ${{ matrix.cmake.install_target }}
46+
-v
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# ref: https://github.com/actions/runner-images
2+
name: amd64 Windows
3+
4+
on: [push, pull_request, workflow_dispatch]
5+
6+
# Building using the github runner environement directly.
7+
jobs:
8+
native:
9+
strategy:
10+
matrix:
11+
cmake: [
12+
{generator: "Visual Studio 17 2022", config: Release, build_target: ALL_BUILD, test_target: RUN_TESTS, install_target: INSTALL},
13+
{generator: "Visual Studio 17 2022", config: Debug, build_target: ALL_BUILD, test_target: RUN_TESTS, install_target: INSTALL},
14+
]
15+
fail-fast: false
16+
name: Windows • ${{ matrix.cmake.generator }} (${{ matrix.cmake.config }})
17+
runs-on: windows-latest
18+
env:
19+
CTEST_OUTPUT_ON_FAILURE: 1
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Check cmake
23+
run: |
24+
cmake --version
25+
cmake -G || true
26+
- name: Configure
27+
run: >
28+
cmake -S. -Bbuild
29+
-G "${{ matrix.cmake.generator }}"
30+
-DCMAKE_CONFIGURATION_TYPES=${{ matrix.cmake.config }}
31+
-DBUILD_DEPS=ON
32+
-DCMAKE_INSTALL_PREFIX=install
33+
- name: Build
34+
run: >
35+
cmake --build build
36+
--config ${{ matrix.cmake.config }}
37+
--target ${{ matrix.cmake.build_target }}
38+
-v -j2
39+
- name: Test
40+
run: >
41+
cmake --build build
42+
--config ${{ matrix.cmake.config }}
43+
--target ${{ matrix.cmake.test_target }}
44+
-v
45+
- name: Install
46+
run: >
47+
cmake --build build
48+
--config ${{ matrix.cmake.config }}
49+
--target ${{ matrix.cmake.install_target }}
50+
-v

.github/workflows/arm64_macos.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# ref: https://github.com/actions/runner-images
2+
name: arm64 MacOS
3+
4+
on: [push, pull_request, workflow_dispatch]
5+
6+
# Building using the github runner environement directly.
7+
jobs:
8+
native:
9+
strategy:
10+
matrix:
11+
cmake: [
12+
{generator: "Xcode", config: Release, build_target: ALL_BUILD, test_target: RUN_TESTS, install_target: install},
13+
{generator: "Unix Makefiles", config: Release, build_target: all, test_target: test, install_target: install},
14+
]
15+
fail-fast: false
16+
name: MacOS • ${{ matrix.cmake.generator }}
17+
runs-on: macos-latest # macos M1 based runner
18+
steps:
19+
- uses: actions/checkout@v4
20+
- name: Check cmake
21+
run: cmake --version
22+
- name: Configure
23+
run: >
24+
cmake -S. -Bbuild
25+
-G "${{ matrix.cmake.generator }}"
26+
-DCMAKE_BUILD_TYPE=${{ matrix.cmake.config }}
27+
-DCMAKE_INSTALL_PREFIX=install
28+
- name: Build
29+
run: >
30+
cmake --build build
31+
--config ${{ matrix.cmake.config }}
32+
--target ${{ matrix.cmake.build_target }}
33+
-v -j2
34+
- name: Test
35+
run: >
36+
CTEST_OUTPUT_ON_FAILURE=1
37+
cmake --build build
38+
--config ${{ matrix.cmake.config }}
39+
--target ${{ matrix.cmake.test_target }}
40+
-v
41+
- name: Install
42+
run: >
43+
cmake --build build
44+
--config ${{ matrix.cmake.config }}
45+
--target ${{ matrix.cmake.install_target }}
46+
-v

0 commit comments

Comments
 (0)