Skip to content

Commit 8923c64

Browse files
hjmjohnsondzenanz
authored andcommitted
ENH: Add CI workflow for Ubuntu 24.04 builds with CMake and Ninja
1 parent e71c5f8 commit 8923c64

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ "**" ]
6+
pull_request:
7+
branches: [ "**" ]
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
build-ubuntu-24-04:
15+
name: Build (Ubuntu 24.04)
16+
runs-on: ubuntu-24.04
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Set up dependencies
23+
run: |
24+
sudo apt-get update
25+
sudo apt-get install -y --no-install-recommends \
26+
build-essential \
27+
cmake \
28+
ninja-build
29+
30+
- name: Configure (CMake, Release)
31+
run: |
32+
cmake -S ${{ github.workspace }} \
33+
-B ${{ github.workspace }}/cmake-build-hidden \
34+
-G Ninja \
35+
-DCMAKE_CXX_FLAGS=" -Wall -Wextra -Wpedantic -Werror=return-type -Wshadow -Wformat=2 -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Wold-style-cast -Wuseless-cast -Wcast-qual -Wswitch-enum -Wnull-dereference -Wvla -Wmissing-field-initializers -Wdouble-promotion -Wnoexcept" \
36+
-DCMAKE_INSTALL_PREFIX=${{ github.workspace }}/cmake-build-install \
37+
-DCMAKE_BUILD_TYPE=Release \
38+
-DBUILD_TESTING=ON \
39+
-DCMAKE_C_VISIBILITY_PRESET=hidden \
40+
-DCMAKE_CXX_VISIBILITY_PRESET=hidden \
41+
-DCMAKE_VISIBILITY_INLINES_HIDDEN=YES \
42+
-DCMAKE_MODULE_LINKER_FLAGS="" \
43+
-DBUILD_SHARED_LIBS=ON
44+
45+
- name: Build targets
46+
run: |
47+
cmake --build ${{ github.workspace }}/cmake-build-hidden --target itkzlib MetaIO -j$(nproc)
48+
49+
- name: Install targets
50+
run: |
51+
cmake --build ${{ github.workspace }}/cmake-build-hidden --target install
52+
53+
# Uncomment if/when tests are available
54+
- name: Run tests
55+
working-directory: ${{ github.workspace }}/cmake-build-hidden
56+
run: ctest --output-on-failure

0 commit comments

Comments
 (0)