forked from firoorg/firo
-
Notifications
You must be signed in to change notification settings - Fork 0
117 lines (111 loc) · 3.29 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
name: Continuous Integration on Master
on:
push:
paths-ignore:
- 'doc/**'
- '**/README.md'
branches:
- master
pull_request:
paths-ignore:
- 'doc/**'
- '**/README.md'
branches:
- master
env:
SOURCE_ARTIFACT: source
jobs:
create-source-distribution:
name: Create Source Distribution
runs-on: ubuntu-latest
env:
ARTIFACT_DIR: source
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 $ARTIFACT_DIR
mv depends.tar.gz firo-*.tar.gz $ARTIFACT_DIR
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: source
path: ${{ env.ARTIFACT_DIR }}
build-linux:
name: Build for Linux
needs: create-source-distribution
runs-on: ubuntu-latest
env:
BIN_DIR: linux-binaries
TEST_LOG_ARTIFACT_DIR: test-logs
steps:
- name: Getting Source
uses: actions/download-artifact@v4
with:
name: ${{ env.SOURCE_ARTIFACT }}
- 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 $BIN-DIR
mv $SOURCE_ARTIFACT/src/{firo-cli,firo-tx,firod,qt/firo-qt} $BIN-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 }}