Debian Codegraph @

monero/.github/workflows/build.yml

raw symbols SCIP
1 name: ci/gh-actions/cli
2
3 on:
4 push:
5 paths-ignore:
6 - 'docs/**'
7 - '**/README.md'
8 pull_request:
9 paths-ignore:
10 - 'docs/**'
11 - '**/README.md'
12
13 # The below variables reduce repetitions across similar targets
14 env:
15 # ARCH="default" (not "native") ensures, that a different execution host can execute binaries compiled elsewhere.
16 BUILD_DEFAULT_LINUX: 'cmake -S . -B build -D ARCH="default" -D BUILD_TESTS=ON -D CMAKE_BUILD_TYPE=Release && cmake --build build --target all && cmake --build build --target wallet_api'
17 APT_INSTALL_LINUX: 'apt -y install build-essential cmake libboost-all-dev miniupnpc libunbound-dev graphviz doxygen libunwind8-dev pkg-config libssl-dev libzmq3-dev libsodium-dev libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler ccache git'
18 APT_SET_CONF: |
19 tee -a /etc/apt/apt.conf.d/80-custom << EOF
20 Acquire::Retries "3";
21 Acquire::http::Timeout "120";
22 Acquire::ftp::Timeout "120";
23 EOF
24 CCACHE_SETTINGS: |
25 ccache --max-size=150M
26 ccache --set-config=compression=true
27
28 jobs:
29 build-macos:
30 name: 'macOS (brew)'
31 runs-on: macOS-latest
32 env:
33 CCACHE_TEMPDIR: /tmp/.ccache-temp
34 steps:
35 - uses: actions/checkout@v4
36 with:
37 submodules: recursive
38 - uses: actions/cache@v4
39 with:
40 path: /Users/runner/Library/Caches/ccache
41 key: ccache-${{ runner.os }}-build-${{ github.sha }}
42 restore-keys: ccache-${{ runner.os }}-build-
43 - uses: ./.github/actions/set-make-job-count
44 - name: install dependencies
45 run: |
46 HOMEBREW_NO_AUTO_UPDATE=1 brew install boost hidapi openssl zmq libpgm miniupnpc expat libunwind-headers protobuf ccache
47 - name: build
48 run: |
49 ${{env.CCACHE_SETTINGS}}
50 make -j${{env.MAKE_JOB_COUNT}}
51
52 build-windows:
53 name: 'Windows (MSYS2)'
54 runs-on: windows-latest
55 env:
56 CCACHE_TEMPDIR: C:\Users\runneradmin\.ccache-temp
57 CCACHE_DIR: C:\Users\runneradmin\.ccache
58 defaults:
59 run:
60 shell: msys2 {0}
61 steps:
62 - uses: actions/checkout@v4
63 with:
64 submodules: recursive
65 - uses: actions/cache@v4
66 with:
67 path: C:\Users\runneradmin\.ccache
68 key: ccache-${{ runner.os }}-build-${{ github.sha }}
69 restore-keys: ccache-${{ runner.os }}-build-
70 - uses: msys2/setup-msys2@v2
71 with:
72 update: true
73 install: mingw-w64-x86_64-toolchain make mingw-w64-x86_64-cmake mingw-w64-x86_64-ccache mingw-w64-x86_64-boost mingw-w64-x86_64-openssl mingw-w64-x86_64-zeromq mingw-w64-x86_64-libsodium mingw-w64-x86_64-hidapi mingw-w64-x86_64-protobuf-c mingw-w64-x86_64-libusb mingw-w64-x86_64-unbound git
74 - uses: ./.github/actions/set-make-job-count
75 - name: build
76 run: |
77 ${{env.CCACHE_SETTINGS}}
78 make release-static-win64 -j${{env.MAKE_JOB_COUNT}}
79
80 build-arch:
81 name: 'Arch Linux'
82 runs-on: ubuntu-latest
83 container:
84 image: archlinux:latest
85 steps:
86 - name: install dependencies
87 run: pacman -Syyu --noconfirm base-devel git cmake boost openssl zeromq unbound libsodium readline expat gtest python3 doxygen graphviz hidapi libusb protobuf
88 - name: configure git
89 run: git config --global --add safe.directory '*'
90 - uses: actions/checkout@v4
91 with:
92 submodules: recursive
93 - uses: ./.github/actions/set-make-job-count
94 - name: build
95 env:
96 CMAKE_BUILD_PARALLEL_LEVEL: ${{env.MAKE_JOB_COUNT}}
97 run: ${{env.BUILD_DEFAULT_LINUX}}
98
99 build-debian:
100 # Oldest supported Debian version
101 name: 'Debian 10'
102 runs-on: ubuntu-latest
103 container:
104 image: debian:10
105 env:
106 DEBIAN_FRONTEND: noninteractive
107 steps:
108 - name: set apt conf
109 run: ${{env.APT_SET_CONF}}
110 - name: update apt
111 run: apt update
112 - name: install monero dependencies
113 run: ${{env.APT_INSTALL_LINUX}}
114 - name: configure git
115 run: git config --global --add safe.directory '*'
116 - uses: actions/checkout@v4
117 with:
118 submodules: recursive
119 - uses: ./.github/actions/set-make-job-count
120 - name: build
121 env:
122 CMAKE_BUILD_PARALLEL_LEVEL: ${{env.MAKE_JOB_COUNT}}
123 run: ${{env.BUILD_DEFAULT_LINUX}}
124
125 build-ubuntu:
126 name: ${{ matrix.name }}
127 runs-on: ubuntu-latest
128 strategy:
129 fail-fast: false
130 matrix:
131 include:
132 # Oldest supported Ubuntu LTS version
133 - name: Ubuntu 20.04
134 container: ubuntu:20.04
135
136 # Most popular Ubuntu LTS version
137 - name: Ubuntu 22.04
138 container: ubuntu:22.04
139 container:
140 image: ${{ matrix.container }}
141 env:
142 DEBIAN_FRONTEND: noninteractive
143 CCACHE_TEMPDIR: /tmp/.ccache-temp
144 CCACHE_DIR: ~/.ccache
145 steps:
146 - name: set apt conf
147 run: ${{env.APT_SET_CONF}}
148 - name: update apt
149 run: apt update
150 - name: install monero dependencies
151 run: ${{env.APT_INSTALL_LINUX}}
152 - name: configure git
153 run: git config --global --add safe.directory '*'
154 - uses: actions/checkout@v4
155 with:
156 submodules: recursive
157 - uses: actions/cache@v4
158 with:
159 path: ~/.ccache
160 key: ccache-${{ matrix.container }}-build-${{ github.sha }}
161 restore-keys: ccache-${{ matrix.container }}-build-
162 - uses: ./.github/actions/set-make-job-count
163 - name: build
164 env:
165 CMAKE_BUILD_PARALLEL_LEVEL: ${{env.MAKE_JOB_COUNT}}
166 run: |
167 ${{env.CCACHE_SETTINGS}}
168 ${{env.BUILD_DEFAULT_LINUX}}
169
170 test-ubuntu:
171 name: "${{ matrix.name }} (tests)"
172 needs: build-ubuntu
173 runs-on: ubuntu-latest
174 strategy:
175 matrix:
176 include:
177 - name: Ubuntu 20.04
178 container: ubuntu:20.04
179 container:
180 image: ${{ matrix.container }}
181 env:
182 DEBIAN_FRONTEND: noninteractive
183 CCACHE_TEMPDIR: /tmp/.ccache-temp
184 CCACHE_DIR: ~/.ccache
185 # Setting up a loop device (losetup) requires additional capabilities.
186 # tests/create_test_disks.sh
187 options: --privileged
188 steps:
189 - name: set apt conf
190 run: ${{env.APT_SET_CONF}}
191 - name: update apt
192 run: apt update
193 - name: install monero dependencies
194 run: ${{env.APT_INSTALL_LINUX}}
195 - name: install pip
196 run: apt install -y python3-pip
197 - name: install Python dependencies
198 run: pip install requests psutil monotonic zmq deepdiff
199 - name: configure git
200 run: git config --global --add safe.directory '*'
201 - uses: actions/checkout@v4
202 with:
203 submodules: recursive
204 - uses: actions/cache@v4
205 with:
206 path: ~/.ccache
207 key: ccache-${{ matrix.container }}-build-${{ github.sha }}
208 restore-keys: ccache-${{ matrix.container }}-build-
209 - name: create dummy disk drives for testing
210 run: tests/create_test_disks.sh >> $GITHUB_ENV
211 - uses: ./.github/actions/set-make-job-count
212 - name: tests
213 env:
214 CTEST_OUTPUT_ON_FAILURE: ON
215 DNS_PUBLIC: tcp://9.9.9.9
216 CMAKE_BUILD_PARALLEL_LEVEL: ${{env.MAKE_JOB_COUNT}}
217 run: |
218 ${{env.CCACHE_SETTINGS}}
219 ${{env.BUILD_DEFAULT_LINUX}}
220 cmake --build build --target test
221
222 source-archive:
223 name: "source archive"
224 runs-on: ubuntu-latest
225 container:
226 image: ubuntu:20.04
227 env:
228 DEBIAN_FRONTEND: noninteractive
229 steps:
230 - name: set apt conf
231 run: ${{env.APT_SET_CONF}}
232 - name: update apt
233 run: apt update
234 - name: install dependencies
235 run: apt install -y git python3-pip
236 - name: configure git
237 run: git config --global --add safe.directory '*'
238 - uses: actions/checkout@v4
239 with:
240 fetch-depth: 0
241 submodules: recursive
242 - name: archive
243 run: |
244 pip install git-archive-all
245 export VERSION="monero-$(git describe)"
246 export OUTPUT="$VERSION.tar"
247 echo "OUTPUT=$OUTPUT" >> $GITHUB_ENV
248 git-archive-all --prefix "$VERSION/" --force-submodules "$OUTPUT"
249 - uses: actions/upload-artifact@v4
250 with:
251 name: ${{ env.OUTPUT }}
252 path: ${{ env.OUTPUT }}