Skip to content

Commit 97be312

Browse files
committed
Add CMake tests to CI
Signed-off-by: Steffen Jaeckel <s@jaeckel.eu>
1 parent 63af5f6 commit 97be312

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,47 @@ jobs:
133133
run: |
134134
make pre_gen
135135
make CFLAGS="-DLTM_DESC -DUSE_LTM" EXTRALIBS="-ltommath" AMALGAM=1 -j$(nproc) check
136+
137+
CMake:
138+
runs-on: ${{ matrix.os }}
139+
strategy:
140+
matrix:
141+
os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm ]
142+
build_type: [ '', -DCMAKE_BUILD_TYPE=Debug, -DCMAKE_BUILD_TYPE=Release, -DCMAKE_BUILD_TYPE=RelWithDebInfo, -DCMAKE_BUILD_TYPE=MinSizeRel ]
143+
cc: [ clang, gcc ]
144+
config:
145+
# Static library build
146+
- { CMAKEOPTIONS: '-DBUILD_SHARED_LIBS=Off' }
147+
# Shared library build
148+
- { CMAKEOPTIONS: '-DBUILD_SHARED_LIBS=On' }
149+
steps:
150+
- uses: actions/checkout@v4
151+
- name: install dependencies
152+
uses: nick-fields/retry@v3
153+
with:
154+
timeout_minutes: 5
155+
max_attempts: 3
156+
retry_on: error
157+
command: |
158+
sudo apt-get update -qq
159+
sudo apt-get remove -y libtommath1
160+
curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash
161+
sudo apt-get install libtommath-git-dev
162+
sudo apt-get install -y cmake gcc clang llvm
163+
- name: build
164+
run: |
165+
mkdir build
166+
cd build
167+
CC=${{ matrix.cc }} cmake ${{ matrix.config.CMAKEOPTIONS }} ${{ matrix.build_type }} ..
168+
make -j$(nproc)
169+
- name: test
170+
run: |
171+
cd build
172+
CC=${{ matrix.cc }} cmake ${{ matrix.config.CMAKEOPTIONS }} ${{ matrix.build_type }} -DBUILD_TESTING=On ..
173+
make -j$(nproc)
174+
ctest
175+
- name: error logs
176+
if: ${{ failure() }}
177+
run: |
178+
cat build/Testing/Temporary/LastTest.log || true
179+
cat demo/build/Testing/Temporary/LastTest.log || true

0 commit comments

Comments
 (0)