forked from dogecoinfoundation/libdogecoin
-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·225 lines (206 loc) · 8.77 KB
/
ci.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
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
# this ci pipeline will build, test and publish (can but currently does not) artifacts for linux, win, macosx
name: CI
on:
pull_request:
branches: [ "*" ]
jobs:
build:
name: ${{ matrix.name }}
env:
CHECK_DOC: "0"
CCACHE_SIZE: "100M"
CCACHE_TEMPDIR: /tmp/.ccache-temp
CCACHE_COMPRESS: "1"
PYTHON_DEBUG: "1"
SDK_URL: https://bitcoincore.org/depends-sources/sdks
strategy:
fail-fast: false
matrix:
name:
- armhf-linux
- aarch64-linux
- x86_64-linux-dbg
- x86_64-macos
- x86_64-win
- i686-win
- i686-linux
include:
- name: armhf-linux
host: arm-linux-gnueabihf
os: ubuntu-20.04
packages: g++-arm-linux-gnueabihf qemu-user-static qemu-user
dep-opts: "CROSS_COMPILE='yes' SPEED=slow V=1"
config-opts: "--enable-static --disable-shared"
run-tests: true
goal: install
- name: aarch64-linux
host: aarch64-linux-gnu
os: ubuntu-20.04
packages: g++-aarch64-linux-gnu qemu-user-static qemu-user
dep-opts: "CROSS_COMPILE='yes' SPEED=slow V=1"
config-opts: "LIBS='-levent_pthreads' --enable-static --disable-shared"
run-tests: true
goal: install
- name: x86_64-linux-dbg
host: x86_64-pc-linux-gnu
os: ubuntu-20.04
run-tests: true
packages: python3-dev python3-dbg python
dep-opts: "DEBUG=1 SPEED=slow V=1"
config-opts: "LD_LIBRARY_PATH='`pwd`/depends/x86_64-pc-linux-gnu/lib/' CFLAGS='-I`pwd`/depends/x86_64-pc-linux-gnu/include/ -fPIC' LDFLAGS='-L`pwd`/depends/x86_64-pc-linux-gnu/lib -static-libgcc -static-libstdc++' PKG_CONFIG_PATH=`pwd`/depends/x86_64-pc-linux-gnu/lib/pkgconfig --enable-static --disable-shared"
goal: install
- name: x86_64-macos
host: x86_64-apple-darwin14
os: macos-latest
run-tests: true
dep-opts: "SPEED=slow V=1"
config-opts: "--enable-static --disable-shared"
packages: cmake zlib xorriso
goal: install
sdk: 12.1
sdk-build: 12A7403
sdk-shasum: "be17f48fd0b08fb4dcd229f55a6ae48d9f781d210839b4ea313ef17dd12d6ea5"
- name: x86_64-win
host: x86_64-w64-mingw32
arch: i386
os: ubuntu-18.04
packages: python3 nsis g++-mingw-w64-x86-64 wine64 wine-stable bc wine-binfmt
postinstall: |
sudo dpkg -s mono-runtime && sudo apt-get remove mono-runtime || echo "Very nothing to uninstall."
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
sudo update-binfmts --import /usr/share/binfmts/wine
dep-opts: "CROSS_COMPILE='yes' SPEED=slow V=1"
config-opts: ""
run-tests: true
goal: install
- name: i686-win
host: i686-w64-mingw32
arch: i386
os: ubuntu-18.04
packages: python3 nsis g++-mingw-w64 wine32 wine-stable bc wine-binfmt
postinstall: |
sudo dpkg -s mono-runtime && sudo apt-get remove mono-runtime || echo "Very nothing to uninstall."
sudo update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix
sudo update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix
sudo update-binfmts --import /usr/share/binfmts/wine
dep-opts: "CROSS_COMPILE='yes' SPEED=slow V=1"
config-opts: ""
run-tests: true
goal: install
- name: i686-linux
host: i686-pc-linux-gnu
os: ubuntu-18.04
packages: g++-multilib bc
run-tests: true
dep-opts: "SPEED=slow V=1"
config-opts: "--enable-static --disable-shared"
goal: install
runs-on: ${{ matrix.os }}
steps:
- name: add architecture
if: ${{ matrix.arch }}
run: |
sudo dpkg --add-architecture ${{ matrix.arch }}
- name: install packages
run: |
if ([ "${{ matrix.name }}" == "x86_64-macos" ]); then
brew update
brew install automake coreutils python3 ${{ matrix.packages }}
echo PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH" >> ~/.bashrc
source ~/.bashrc
else
sudo apt-get update
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y autoconf automake libtool-bin libevent-dev build-essential curl python3 valgrind ${{ matrix.packages }}
fi
- name: post install
if: ${{ matrix.postinstall }}
run: ${{ matrix.postinstall }}
- name: checkout
uses: actions/checkout@v2
- name: sdk cache
if: ${{ matrix.sdk }}
uses: actions/cache@v2
env:
cache-name: sdk
with:
path: ./depends/sdk-sources
key: ${{ matrix.name }}-${{ env.cache-name }}-${{ hashFiles('.github/workflows/ci.yml') }}
- name: install sdk
if: ${{ matrix.sdk }}
env:
sdk-filename: Xcode-${{ matrix.sdk }}-${{ matrix.sdk-build }}-extracted-SDK-with-libcxx-headers.tar.gz
run: |
mkdir -p ./depends/sdk-sources
mkdir -p ./depends/SDKs
echo "${{ matrix.sdk-shasum }} depends/sdk-sources/${{ env.sdk-filename }}" | sha256sum -c || \
curl --location --fail $SDK_URL/${{ env.sdk-filename }} -o depends/sdk-sources/${{ env.sdk-filename }} &&\
echo "${{ matrix.sdk-shasum }} depends/sdk-sources/${{ env.sdk-filename }}" | sha256sum -c
tar -C depends/SDKs -xf depends/sdk-sources/${{ env.sdk-filename }}
- name: dependency cache
uses: actions/cache@v2
env:
cache-name: depends
with:
path: ./depends/built
key: ${{ matrix.name }}-${{ env.cache-name }}-${{ hashFiles('depends/packages/*') }}
- name: build depends
run: |
make $MAKEJOBS -C depends HOST=${{ matrix.host }} ${{ matrix.dep-opts }}
- name: ccache
uses: actions/cache@v2
env:
cache-name: ccache
with:
path: ~/.ccache
key: ${{ matrix.name }}-${{ env.cache-name }}-${{ hashFiles('**/configure.ac') }}
- name: configure libdogecoin
run: |
depends/${{ matrix.host }}/native/bin/ccache --max-size=$CCACHE_SIZE
./autogen.sh
./configure --prefix=`pwd`/depends/${{ matrix.host }} ${{ matrix.config-opts }} HOST=${{ matrix.host }} || ( cat config.log && false)
- name: build libdogecoin
run: |
make -j"$(getconf _NPROCESSORS_ONLN)" SPEED=slow V=1
mkdir -p ./build/libdogecoin-${{ github.sha }}-${{ matrix.name }}
if ([ "${{ matrix.name }}" == "x86_64-win" ] || [ "${{ matrix.name }}" == "i686-win" ]); then
cp .libs/* such.exe sendtx.exe ./build/libdogecoin-${{ github.sha }}-${{ matrix.name }}/
else
cp .libs/* such sendtx ./build/libdogecoin-${{ github.sha }}-${{ matrix.name }}/
fi
chmod +x ./build/libdogecoin-${{ github.sha }}-${{ matrix.name }}/*
- name: test libdogecoin
if: ${{ matrix.run-tests }}
run: |
case "${{ matrix.name }}" in
"armhf-linux")
qemu-arm -E LD_LIBRARY_PATH=/usr/arm-linux-gnueabihf/lib/ /usr/arm-linux-gnueabihf/lib/ld-linux-armhf.so.3 ./tests
;;
"aarch64-linux")
qemu-aarch64 -E LD_LIBRARY_PATH=/usr/aarch64-linux-gnu/lib/ /usr/aarch64-linux-gnu/lib/ld-linux-aarch64.so.1 ./tests
;;
"x86_64-win")
make check -j"$(getconf _NPROCESSORS_ONLN)" V=1
;;
"i686-win")
make check -j"$(getconf _NPROCESSORS_ONLN)" V=1
;;
"x86_64-macos")
./tests
;;
"x86_64-linux-dbg")
make check -j"$(getconf _NPROCESSORS_ONLN)" V=1
python3 tooltests.py
./wrappers/python/pytest/cython_tests.sh -host=${{ matrix.host }}
./wrappers/golang/libdogecoin/build.sh
;;
"i686-linux")
make check -j"$(getconf _NPROCESSORS_ONLN)" V=1
;;
esac
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: libdogecoin-${{ github.sha }}-${{ matrix.name }}
path: |
${{ github.workspace }}/build/libdogecoin-${{ github.sha }}-${{ matrix.name }}