-
-
Notifications
You must be signed in to change notification settings - Fork 354
204 lines (201 loc) · 6.65 KB
/
ci-master.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
name: Continuous Integration on Master
on:
push:
paths-ignore:
- 'doc/**'
- '**/README.md'
branches:
- '**'
pull_request:
paths-ignore:
- 'doc/**'
- '**/README.md'
branches:
- master
env:
SOURCE_ARTIFACT: source
SOURCE_ARTIFACT_DIR: source
jobs:
create-source-distribution:
name: Create Source Distribution
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Required Packages
run: |
sudo apt-get update
sudo apt-get install -y libboost-all-dev libdb-dev libdb++-dev libevent-dev bison
- name: Create Distribution Tarball
run: |
./autogen.sh
./configure --with-incompatible-bdb ac_cv_lib_tor_tor_main=yes
make dist
- name: Download Dependencies
run: make -C depends download
- name: Create Dependencies Tarball
run: tar -czf depends.tar.gz depends
- name: Prepare Files for Artifact
run: |
mkdir -p $SOURCE_ARTIFACT_DIR
mv depends.tar.gz firo-*.tar.gz $SOURCE_ARTIFACT_DIR
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.SOURCE_ARTIFACT }}
path: ${{ env.SOURCE_ARTIFACT_DIR }}
build-linux:
name: Build for Linux
needs: create-source-distribution
runs-on: ubuntu-latest
env:
ARTIFACT_DIR: linux-binaries
TEST_LOG_ARTIFACT_DIR: test-logs
steps:
- name: Getting Source
uses: actions/download-artifact@v4
with:
name: ${{ env.SOURCE_ARTIFACT }}
path: ${{ env.SOURCE_ARTIFACT_DIR }}
- name: Extract Archives
run: |
tar -xzf depends.tar.gz
tar -xzf firo-*.tar.gz --strip-components=1
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Install Required Packages
run: |
sudo apt-get update
sudo apt-get install -y python3-zmq
- name: Build Dependencies
run: make -C depends -j$(nproc)
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Build Firo
run: |
./configure --disable-jni --enable-tests --with-comparison-tool=no --prefix=$(realpath depends/x86_64-pc-linux-gnu)
make -j$(nproc)
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Run Unit Tests
run: make check
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Run RPC Tests
env:
TIMEOUT: 600
run: qa/pull-tester/rpc-tests.py -extended
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Prepare Files for Artifact
run: |
mkdir -p $ARTIFACT_DIR
mv $SOURCE_ARTIFACT/src/{firo-cli,firo-tx,firod,qt/firo-qt} $ARTIFACT_DIR
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: linux-binaries
path: ${{ env.ARTIFACT_DIR }}
- name: Prepare Test Logs for Artifact
if: failure()
run: |
tor_log=$SOURCE_ARTIFACT/src/tor/test-suite.log
firo_log=$SOURCE_ARTIFACT/src/test-suite.log
mkdir -p $TEST_LOG_ARTIFACT_DIR
if test -f $tor_log; then
mv $tor_log $TEST_LOG_ARTIFACT_DIR/tor.log
fi
if test -f $firo_log; then
mv $firo_log $TEST_LOG_ARTIFACT_DIR/firo.log
fi
- name: Upload Test Logs Artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-logs
path: ${{ env.TEST_LOG_ARTIFACT_DIR }}
build-windows:
name: Build for Windows
needs: create-source-distribution
runs-on: ubuntu-20.04
env:
ARTIFACT_DIR: windows-binaries
steps:
- name: Getting Source
uses: actions/download-artifact@v4
with:
name: ${{ env.SOURCE_ARTIFACT }}
path: ${{ env.SOURCE_ARTIFACT_DIR }}
- name: Extract Archives
run: |
tar -xzf depends.tar.gz
tar -xzf firo-*.tar.gz --strip-components=1
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Install Required Packages
run: |
sudo apt-get update
sudo apt-get install -y g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64
- name: Switch MinGW GCC and G++ to POSIX Threading
run: |
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
- name: Build Dependencies
run: make -C depends -j$(nproc) HOST=x86_64-w64-mingw32
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Build Firo
run: |
./configure --without-libs --disable-jni --prefix=$(realpath depends/x86_64-w64-mingw32)
make -j$(nproc)
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Prepare Files for Artifact
run: |
mkdir -p $ARTIFACT_DIR
mv $SOURCE_ARTIFACT/src/{firo-cli.exe,firo-tx.exe,firod.exe,qt/firo-qt.exe} $ARTIFACT_DIR
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: windows-binaries
path: ${{ env.ARTIFACT_DIR }}
build-mac:
name: Build for macOS
needs: create-source-distribution
runs-on: macos-latest
env:
ARTIFACT_DIR: mac-binaries
steps:
- name: Getting Source
uses: actions/download-artifact@v4
with:
name: ${{ env.SOURCE_ARTIFACT }}
path: ${{ env.SOURCE_ARTIFACT_DIR }}
- name: Extract Archives
run: |
tar -xzf depends.tar.gz
tar -xzf firo-*.tar.gz --strip-components=1
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Use Xcode instead of Command Line Tools
run: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
- name: Install Required Packages
run: |
if ! command -v pkg-config &> /dev/null; then
echo "pkg-config not found, installing..."
brew install pkg-config
else
echo "pkg-config is already installed"
fi
brew install automake coreutils python-setuptools
# Workaround for macOS: https://github.com/actions/runner/issues/2958
- name: Install setuptools
run: sudo -H pip install setuptools
- name: Build Dependencies
run: make -C depends -j$(sysctl -n hw.activecpu)
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Build Firo
run: |
./configure --prefix=`pwd`/depends/`depends/config.guess`
make -j$(sysctl -n hw.activecpu)
working-directory: ${{ env.SOURCE_ARTIFACT }}
- name: Prepare Files for Artifact
run: |
mkdir -p $ARTIFACT_DIR
mv $SOURCE_ARTIFACT/src/{firo-cli,firo-tx,firod,qt/firo-qt} $ARTIFACT_DIR
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: mac-binaries
path: ${{ env.ARTIFACT_DIR }}