forked from digibyte/digibyte
-
Notifications
You must be signed in to change notification settings - Fork 86
255 lines (215 loc) · 8.71 KB
/
ci.yml
File metadata and controls
255 lines (215 loc) · 8.71 KB
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
# Copyright (c) 2023 The DigiByte Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
name: CI
on:
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request.
pull_request:
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push.
push:
branches:
- develop
- master
- 'release/**'
tags-ignore:
- '**'
concurrency:
group: ${{ github.event_name != 'pull_request' && github.run_id || github.ref }}
cancel-in-progress: true
env:
DANGER_RUN_CI_ON_HOST: 1
CI_FAILFAST_TEST_LEAVE_DANGLING: 1 # GHA does not care about dangling processes and setting this variable avoids killing the CI script itself on error
MAKEJOBS: '-j10'
jobs:
macos-native-arm64:
name: 'macOS 14 native, ARM64, Qt GUI, with depends, unit tests, functional tests'
# Use latest M1 runner
runs-on: macos-14
# No need to run on the read-only mirror, unless it is a PR.
if: github.repository != 'digibyte-core/gui' || github.event_name == 'pull_request'
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Clang version
run: |
clang --version
- name: Cache Homebrew
id: brew-cache
uses: actions/cache@v3
with:
path: |
~/Library/Caches/Homebrew
/opt/homebrew/Cellar
/opt/homebrew/opt
key: ${{ github.job }}-brew-v1
restore-keys: ${{ github.job }}-brew-
- name: Install Homebrew packages
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_AUTO_UPDATE: 1
run: |
# A workaround for "The `brew link` step did not complete successfully" error.
brew install python@3 || brew link --overwrite python@3
brew install autoconf automake libtool pkg-config gnu-getopt ccache boost libevent miniupnpc libnatpmp zeromq qt@5 qrencode || true
# Force link all required tools
brew link --force --overwrite autoconf automake libtool ccache boost miniupnpc libnatpmp zeromq qt@5 qrencode || true
- name: Set Ccache directory
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
- name: Restore Ccache cache
id: ccache-cache
uses: actions/cache/restore@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ github.job }}-ccache-${{ github.run_id }}
restore-keys: ${{ github.job }}-ccache-
- name: Install Python Packages
run: |
pip3 install --break-system-packages pypandoc digibyte_scrypt pyzmq
- name: Restore depends cache
id: depends-cache
uses: actions/cache/restore@v3
with:
path: depends/arm64-apple-darwin
key: ${{ github.job }}-depends-${{ github.sha }}
restore-keys: ${{ github.job }}-depends-
- name: Build Dependencies
if: steps.depends-cache.outputs.cache-hit != 'true'
run: |
cd depends
make -j2 HOST=arm64-apple-darwin
cd ..
- name: Save depends cache
uses: actions/cache/save@v3
if: github.event_name != 'pull_request' && steps.depends-cache.outputs.cache-hit != 'true'
with:
path: depends/arm64-apple-darwin
key: ${{ github.job }}-depends-${{ github.sha }}
- name: Cache build artifacts
id: build-cache
uses: actions/cache@v3
with:
path: |
src/digibyte
src/digibyte-cli
src/digibyte-tx
src/qt/digibyte-qt
src/test/test_digibyte
src/bench/bench_digibyte
key: ${{ github.job }}-build-${{ github.sha }}
restore-keys: ${{ github.job }}-build-
- name: Configure and Build
run: |
# Set paths for macOS tools
export PATH="$(brew --prefix)/bin:$(brew --prefix)/opt/automake/bin:$(brew --prefix)/opt/autoconf/bin:$(brew --prefix)/opt/libtool/bin:$PATH"
export Qt5_DIR="$(brew --prefix qt@5)"
export PATH="$Qt5_DIR/bin:$PATH"
export PKG_CONFIG_PATH="$Qt5_DIR/lib/pkgconfig:$PKG_CONFIG_PATH"
./autogen.sh
CONFIG_SITE=$PWD/depends/arm64-apple-darwin/share/config.site ./configure --with-gui=yes --enable-reduce-exports
make -j2
- name: Run Unit Tests
run: ./src/test/test_digibyte --show_progress
- name: Run Functional Tests
run: test/functional/test_runner.py --jobs=1
- name: Upload Test Suite Log
uses: actions/upload-artifact@v4
if: failure()
with:
name: arm64-test-suite-log
path: src/test-suite.log
- name: Save Ccache cache
uses: actions/cache/save@v3
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
with:
path: ${{ env.CCACHE_DIR }}
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
key: ${{ github.job }}-ccache-${{ github.run_id }}
- name: Save Homebrew cache
uses: actions/cache/save@v3
if: steps.brew-cache.outputs.cache-hit != 'true'
with:
path: |
~/Library/Caches/Homebrew
/opt/homebrew/Cellar
/opt/homebrew/opt
key: ${{ github.job }}-brew-v1
linux-native:
name: 'Ubuntu 22.04 native, Qt GUI, with depends, unit tests, functional tests'
runs-on: ubuntu-22.04
# No need to run on the read-only mirror, unless it is a PR.
if: github.repository != 'digibyte-core/gui' || github.event_name == 'pull_request'
timeout-minutes: 120
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libtool autotools-dev automake pkg-config bsdmainutils python3-zmq python3 libevent-dev libboost-dev libsqlite3-dev libdb++-dev systemtap-sdt-dev libminiupnpc-dev libnatpmp-dev qtbase5-dev qttools5-dev qttools5-dev-tools qtwayland5 libqrencode-dev ccache curl ca-certificates
- name: Set Ccache directory
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
- name: Restore Ccache cache
id: ccache-cache
uses: actions/cache/restore@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ github.job }}-ccache-${{ github.run_id }}
restore-keys: ${{ github.job }}-ccache-
- name: Install Python Packages
run: |
pip3 install pypandoc digibyte_scrypt pyzmq
- name: Restore depends cache
id: depends-cache
uses: actions/cache/restore@v3
with:
path: depends/x86_64-pc-linux-gnu
key: ${{ github.job }}-depends-${{ github.sha }}
restore-keys: ${{ github.job }}-depends-
- name: Build Dependencies
if: steps.depends-cache.outputs.cache-hit != 'true'
run: |
cd depends
make -j$(nproc) HOST=x86_64-pc-linux-gnu
cd ..
- name: Save depends cache
uses: actions/cache/save@v3
if: github.event_name != 'pull_request' && steps.depends-cache.outputs.cache-hit != 'true'
with:
path: depends/x86_64-pc-linux-gnu
key: ${{ github.job }}-depends-${{ github.sha }}
- name: Cache build artifacts
id: build-cache
uses: actions/cache@v3
with:
path: |
src/digibyte
src/digibyte-cli
src/digibyte-tx
src/qt/digibyte-qt
src/test/test_digibyte
src/bench/bench_digibyte
key: ${{ github.job }}-build-${{ github.sha }}
restore-keys: ${{ github.job }}-build-
- name: Configure and Build
run: |
./autogen.sh
CONFIG_SITE=$PWD/depends/x86_64-pc-linux-gnu/share/config.site ./configure --with-gui=yes --enable-reduce-exports
make -j$(nproc)
- name: Run Unit Tests
run: ./src/test/test_digibyte --show_progress
- name: Run Functional Tests
run: test/functional/test_runner.py --jobs=1
- name: Upload Test Suite Log
uses: actions/upload-artifact@v4
if: failure()
with:
name: linux-test-suite-log
path: src/test-suite.log
- name: Save Ccache cache
uses: actions/cache/save@v3
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
with:
path: ${{ env.CCACHE_DIR }}
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
key: ${{ github.job }}-ccache-${{ github.run_id }}