Skip to content

Commit 6ad2ce9

Browse files
authored
Merge pull request #715 from libtom/add-cmake-tests
Add CMake & arm64 tests to CI
2 parents 63af5f6 + 0572f95 commit 6ad2ce9

1 file changed

Lines changed: 46 additions & 5 deletions

File tree

.github/workflows/main.yml

Lines changed: 46 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,10 @@ jobs:
6363
steps:
6464
- uses: actions/checkout@v4
6565
- name: install dependencies
66-
uses: nick-fields/retry@v3
66+
uses: nick-fields/retry@v4.0.0
6767
with:
6868
timeout_minutes: 20
6969
max_attempts: 3
70-
retry_on: error
7170
command: |
7271
sudo apt-get update -qq
7372
sudo apt-get install -y libgmp-dev valgrind libtool-bin clang-tools lcov ruby clang
@@ -117,11 +116,10 @@ jobs:
117116
steps:
118117
- uses: actions/checkout@v4
119118
- name: install dependencies
120-
uses: nick-fields/retry@v3
119+
uses: nick-fields/retry@v4.0.0
121120
with:
122-
timeout_minutes: 5
121+
timeout_minutes: 20
123122
max_attempts: 3
124-
retry_on: error
125123
command: |
126124
sudo apt-get update -qq
127125
sudo apt-get remove -y libtommath1
@@ -133,3 +131,46 @@ jobs:
133131
run: |
134132
make pre_gen
135133
make CFLAGS="-DLTM_DESC -DUSE_LTM" EXTRALIBS="-ltommath" AMALGAM=1 -j$(nproc) check
134+
135+
CMake:
136+
runs-on: ${{ matrix.os }}
137+
strategy:
138+
matrix:
139+
os: [ ubuntu-22.04, ubuntu-24.04, ubuntu-22.04-arm, ubuntu-24.04-arm ]
140+
build_type: [ '', -DCMAKE_BUILD_TYPE=Debug, -DCMAKE_BUILD_TYPE=Release, -DCMAKE_BUILD_TYPE=RelWithDebInfo, -DCMAKE_BUILD_TYPE=MinSizeRel ]
141+
cc: [ clang, gcc ]
142+
config:
143+
# Static library build
144+
- { CMAKEOPTIONS: '-DBUILD_SHARED_LIBS=Off' }
145+
# Shared library build
146+
- { CMAKEOPTIONS: '-DBUILD_SHARED_LIBS=On' }
147+
steps:
148+
- uses: actions/checkout@v4
149+
- name: install dependencies
150+
uses: nick-fields/retry@v4.0.0
151+
with:
152+
timeout_minutes: 20
153+
max_attempts: 3
154+
command: |
155+
sudo apt-get update -qq
156+
sudo apt-get remove -y libtommath1
157+
curl -s https://packagecloud.io/install/repositories/libtom/packages/script.deb.sh | sudo bash
158+
sudo apt-get install libtommath-git-dev
159+
sudo apt-get install -y cmake gcc clang llvm
160+
- name: build
161+
run: |
162+
mkdir build
163+
cd build
164+
CC=${{ matrix.cc }} cmake ${{ matrix.config.CMAKEOPTIONS }} ${{ matrix.build_type }} ..
165+
make -j$(nproc)
166+
- name: test
167+
run: |
168+
cd build
169+
CC=${{ matrix.cc }} cmake ${{ matrix.config.CMAKEOPTIONS }} ${{ matrix.build_type }} -DBUILD_TESTING=On ..
170+
make -j$(nproc)
171+
ctest
172+
- name: error logs
173+
if: ${{ failure() }}
174+
run: |
175+
cat build/Testing/Temporary/LastTest.log || true
176+
cat demo/build/Testing/Temporary/LastTest.log || true

0 commit comments

Comments
 (0)