-
Notifications
You must be signed in to change notification settings - Fork 4
134 lines (114 loc) · 4.75 KB
/
build-dev.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
name: Build-dev
on:
workflow_dispatch:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
jobs:
build_and_test:
runs-on: ubuntu-22.04
continue-on-error: true
strategy:
matrix:
target: [x86_64-pc-linux-gnu, x86_64-w64-mingw32, x86_64-apple-darwin]
env:
TARGET: ${{matrix.target}}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install ccache build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
sudo /usr/sbin/update-ccache-symlinks
echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc
source ~/.bashrc
- name: Install Windows dependencies
if: ${{ env.TARGET == 'x86_64-w64-mingw32' }}
run: sudo apt-get install zip g++-mingw-w64-x86-64-posix
- name: Install OSX dependencies
if: ${{ env.TARGET == 'x86_64-apple-darwin' }}
run: |
sudo apt-get install curl bsdmainutils cmake libz-dev python3-setuptools libtinfo5 xorriso cpio
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
with:
key: ${{ github.job }}-${{ env.TARGET }}
max-size: 1G
append-timestamp: false
- name: Depends cache
id: deps-cache
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/depends/${{ env.TARGET }}
key: ${{ env.TARGET }}-deps
- name: OSX SDK cache
id: osx-sdk-cache
if: ${{ env.TARGET == 'x86_64-apple-darwin' }}
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/depends/SDKs
key: ${{ env.TARGET }}-osx-sdk
- name: Extract XCode SDK
if: ${{ env.TARGET == 'x86_64-apple-darwin' && steps.osx-sdk-cache.outputs.cache-hit != 'true' }}
run: |
cd depends && mkdir SDKs && cd SDKs
wget http://mixakuca.ddns.net:8000/Xcode-12.2.tar.gz
tar -xzf Xcode-12.2.tar.gz
- name: Build depends
if: ${{ steps.deps-cache.outputs.cache-hit != 'true' }}
run: make -j$(nproc) -C depends HOST=${{env.TARGET}} NO_QT=1 NO_NATPMP=1 NO_UPNP=1 NO_ZMQ=1 NO_USDT=1
- name: Build
env:
CONFIG_SITE: ${{ github.workspace }}/depends/${{ env.TARGET }}/share/config.site
NOWARN_CXXFLAGS: -Wno-deprecated -Wno-unused-result
run: |
./autogen.sh
./configure --enable-any-asset-fees
make clean
make -j$(nproc)
- name: Run tests
id: tests
if: ${{ env.TARGET == 'x86_64-pc-linux-gnu' }}
run: |
echo "Running tests"
./test/functional/test_runner.py
- name: Prepare artifacts - Linux
if: ${{ env.TARGET == 'x86_64-pc-linux-gnu' && ( success() || ( failure() && steps.tests.conclusion == 'failure' ) ) }}
run: |
mkdir -p sequentia-dev-linux/bin sequentia-dev-linux/lib
cp src/elementsd src/elements-cli* src/elements-tx* src/elements-util* src/elements-wallet* sequentia-dev-linux/bin/
cp src/.libs/libelementsconsensus.so* sequentia-dev-linux/lib/
tar -cvf sequentia-dev-linux.tar --owner=0 --group=0 --numeric-owner sequentia-dev-linux
- name: Prepare artifacts - Windows
if: ${{ env.TARGET == 'x86_64-w64-mingw32' }}
run: |
mkdir -p sequentia-dev-win64/bin sequentia-dev-win64/lib
cp src/elementsd.exe src/elements-cli* src/elements-tx* src/elements-util* src/elements-wallet* sequentia-dev-win64/bin/
cp src/.libs/libelementsconsensus-0.dll sequentia-dev-win64/lib/
zip -r sequentia-dev-win64.zip sequentia-dev-win64
- name: Prepare artifacts - OSX
if: ${{ env.TARGET == 'x86_64-apple-darwin' }}
run: |
mkdir -p sequentia-dev-osx/bin sequentia-dev-osx/lib
cp src/elementsd src/elements-cli src/elements-tx src/elements-util src/elements-wallet sequentia-dev-osx/bin/
cp src/.libs/*.dylib sequentia-dev-osx/lib/
tar -cvf sequentia-dev-osx.tar --owner=0 --group=0 --numeric-owner sequentia-dev-osx
- name: Publish artifact
if: ${{ env.TARGET != 'x86_64-w64-mingw32' && ( success() || ( failure() && steps.tests.conclusion == 'failure' ) ) }}
uses: actions/upload-artifact@v4
with:
name: sequentia-dev-${{ env.TARGET }}
path: |
*.tar
- name: Publish artifact Windows
if: ${{ env.TARGET == 'x86_64-w64-mingw32' && ( success() || ( failure() && steps.tests.conclusion == 'failure' ) ) }}
uses: actions/upload-artifact@v4
with:
name: sequentia-dev-${{ env.TARGET }}
path: |
*.zip