-
Notifications
You must be signed in to change notification settings - Fork 8
116 lines (84 loc) · 2.87 KB
/
cmake.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: CMake
on: [push, pull_request]
env:
BUILD_TYPE: Release
jobs:
build-debian-system-reproducible:
if: true
runs-on: ubuntu-latest
container:
image: debian:bookworm
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: apt-get -y update && apt-get install -y libgmp-dev build-essential cmake
- name: Cmake pass 1
run: cmake -G "Unix Makefiles" -B./build1 -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build pass 1
run: cmake --build ./build1
- name: Cmake pass 2
run: cmake -G "Unix Makefiles" -B./build2 -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build pass 2
run: cmake --build ./build2
- name: Check hashes
run: |
ls -la build1
hash1=$(sha256sum build1/libbncsutil.so | cut -d ' ' -f 1)
hash2=$(sha256sum build2/libbncsutil.so | cut -d ' ' -f 1)
echo "Hash 1: $hash1\n"
echo "Hash 2: $hash2\n"
[ "$hash1" = "$hash2" ] && exit 0 || exit 1
build-debian-conan:
if: true
runs-on: ubuntu-latest
container:
image: debian:bookworm
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: apt-get -y update && apt-get install -y python3 python3-pip build-essential cmake
- name: Install conan
run: pip install conan --break-system-packages
- name: Init conan
run: conan profile detect
- name: Install deps with conan
run: conan install . -of build -s build_type=$BUILD_TYPE --build=missing
- name: Cmake
working-directory: build
run: bash conanbuild.sh && cmake .. -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DUSE_SYSTEM_LIBS=0
- name: Build
working-directory: build
run: cmake --build . --config Release
build-fedora-system:
if: true
runs-on: ubuntu-latest
container:
image: fedora:latest
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: dnf -y install gmp-devel make automake clang cmake
- name: Cmake
run: cmake -G "Unix Makefiles" -B./build -DCMAKE_BUILD_TYPE=$BUILD_TYPE
- name: Build
run: cmake --build ./build
build-windows-conan:
if: true
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: TheMrMilchmann/setup-msvc-dev@v3
with:
arch: x64
- name: Install Conan
id: conan
uses: turtlebrowser/get-conan@main
- name: Init conan
run: conan profile detect
- name: Install dependencies
shell: cmd
run: conan install . -of build -s build_type=Release -o *:shared=False --build=missing
- name: Build
shell: cmd
working-directory: ./build
run: .\conanbuild.bat && cmake .. -G "Visual Studio 17 2022" -DCMAKE_TOOLCHAIN_FILE=conan_toolchain.cmake -DBUILD_SHARED_LIBS=1 && cmake --build . --config Release