Skip to content

Commit 1c52ffb

Browse files
committed
ci: Initial CMake CI
1 parent 3809865 commit 1c52ffb

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/cmake-ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CMake CI
2+
on:
3+
- push
4+
- pull_request
5+
- workflow_dispatch
6+
7+
jobs:
8+
test-linux:
9+
runs-on: ubuntu-latest
10+
env:
11+
CCACHE_DIR: ${{github.workspace}}/ccache
12+
CCACHE_MAXSIZE: 100M
13+
strategy:
14+
matrix:
15+
tag:
16+
- minimal
17+
- no-asm
18+
- gui-full
19+
- system-libs
20+
include:
21+
- tag: no-asm
22+
deps: null
23+
options: -DUSE_ASM=OFF
24+
- tag: gui-full
25+
deps: libminiupnpc-dev libqrencode-dev qtbase5-dev qttools5-dev
26+
options: -DENABLE_GUI=ON -DENABLE_QRENCODE=ON -DENABLE_UPNP=ON -DUSE_DBUS=ON
27+
- tag: system-libs
28+
deps: libsecp256k1-dev libunivalue-dev xxd
29+
options: -DSYSTEM_UNIVALUE=ON
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@v3
33+
- name: Install dependencies
34+
uses: awalsh128/cache-apt-pkgs-action@latest
35+
with:
36+
packages: |
37+
${{matrix.deps}}
38+
ccache
39+
libcurl4-openssl-dev
40+
libdb5.3++-dev
41+
libleveldb-dev
42+
libsnappy-dev
43+
libzip-dev
44+
zipcmp
45+
zipmerge
46+
ziptool
47+
version: ${{matrix.tag}}
48+
- name: Install Boost dependencies
49+
run: |
50+
sudo apt-get install -y \
51+
libboost-dev \
52+
libboost-date-time-dev \
53+
libboost-exception-dev \
54+
libboost-filesystem-dev \
55+
libboost-iostreams-dev \
56+
libboost-serialization-dev \
57+
libboost-test-dev \
58+
libboost-thread-dev
59+
- name: Configure
60+
run: |
61+
cmake -B ${{github.workspace}}/build \
62+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
63+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
64+
${{matrix.options}} \
65+
-DENABLE_TESTS=ON
66+
- name: Restore cache
67+
uses: actions/cache/restore@v3
68+
with:
69+
key: ccache-linux-${{matrix.tag}}
70+
path: ${{github.workspace}}/ccache
71+
- name: Build
72+
run: |
73+
cmake --build ${{github.workspace}}/build -v -j $(nproc)
74+
- name: Save cache
75+
uses: actions/cache@v3
76+
with:
77+
key: ccache-linux-${{matrix.tag}}
78+
path: ${{github.workspace}}/ccache
79+
- name: Run tests
80+
run: |
81+
ctest --test-dir ${{github.workspace}}/build -j $(nproc)
82+
- name: Upload test logs
83+
uses: actions/upload-artifact@v3
84+
if: always()
85+
with:
86+
name: linux-test-logs
87+
path: ${{github.workspace}}/build/Testing/Temporary/LastTest.log
88+
retention-days: 7

0 commit comments

Comments
 (0)