forked from monero-project/monero
-
Notifications
You must be signed in to change notification settings - Fork 4
150 lines (147 loc) · 5.89 KB
/
Copy pathdepends.yml
File metadata and controls
150 lines (147 loc) · 5.89 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
name: ci/gh-actions/depends
on:
push:
paths-ignore:
- 'docs/**'
- '**/README.md'
pull_request:
paths-ignore:
- 'docs/**'
- '**/README.md'
env:
APT_SET_CONF: |
tee -a /etc/apt/apt.conf.d/80-custom << EOF
Acquire::Retries "3";
Acquire::http::Timeout "120";
Acquire::ftp::Timeout "120";
EOF
CCACHE_SETTINGS: |
ccache --max-size=150M
USE_DEVICE_TREZOR_MANDATORY: ON
jobs:
build-cross:
runs-on: ubuntu-latest
container:
image: ${{ matrix.toolchain.container || 'ubuntu:22.04' }}
env:
DEBIAN_FRONTEND: noninteractive
strategy:
fail-fast: false
matrix:
toolchain:
- name: "RISCV 64bit"
host: "riscv64-linux-gnu"
rust_host: "riscv64gc-unknown-linux-gnu"
packages: "g++-riscv64-linux-gnu"
container: "ubuntu:26.04" # RandomX v2 requires GCC 14 or above for riscv64
- name: "ARM v8"
host: "aarch64-linux-gnu"
rust_host: "aarch64-unknown-linux-gnu"
packages: "g++-aarch64-linux-gnu"
- name: "i686 Linux"
host: "i686-pc-linux-gnu"
rust_host: "i686-unknown-linux-gnu"
packages: "g++-multilib"
- name: "Win64"
host: "x86_64-w64-mingw32"
rust_host: "x86_64-pc-windows-gnu"
packages: "g++-mingw-w64-x86-64"
container: "ubuntu:24.04" # Rust >= 1.70 requires binutils >= 2.40
- name: "x86_64 Linux"
host: "x86_64-unknown-linux-gnu"
rust_host: "x86_64-unknown-linux-gnu"
- name: "Cross-Mac x86_64"
host: "x86_64-apple-darwin"
rust_host: "x86_64-apple-darwin"
packages: "clang-19 lld-19"
- name: "Cross-Mac aarch64"
host: "arm64-apple-darwin"
rust_host: "aarch64-apple-darwin"
packages: "clang-19 lld-19"
- name: "x86_64 Freebsd"
host: "x86_64-unknown-freebsd"
rust_host: "x86_64-unknown-freebsd"
packages: "clang"
- name: "ARMv7 Android"
host: "arm-linux-android"
rust_host: "armv7-linux-androideabi"
packages: "unzip"
- name: "ARMv8 Android"
host: "aarch64-linux-android"
rust_host: "aarch64-linux-android"
packages: "unzip"
name: ${{ matrix.toolchain.name }}
steps:
- name: set apt conf
run: ${{env.APT_SET_CONF}}
- name: install packages
run: apt update; apt -y install ca-certificates curl
- name: prepare apple-darwin
if: ${{ matrix.toolchain.host == 'x86_64-apple-darwin' || matrix.toolchain.host == 'arm64-apple-darwin' }}
run: |
cat << EOF >> /etc/apt/sources.list
deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-19 main
EOF
curl https://apt.llvm.org/llvm-snapshot.gpg.key > /etc/apt/trusted.gpg.d/apt.llvm.org.asc
echo "/usr/lib/llvm-19/bin/" >> $GITHUB_PATH
- name: install dependencies
run: apt update; apt -y install build-essential cmake pkg-config git ccache ${{ matrix.toolchain.packages }}
- name: install rust
run: |
curl -O https://static.rust-lang.org/rustup/archive/1.29.0/x86_64-unknown-linux-gnu/rustup-init
echo "4acc9acc76d5079515b46346a485974457b5a79893cfb01112423c89aeb5aa10 rustup-init" | sha256sum -c
chmod +x rustup-init
./rustup-init -y --default-toolchain 1.93 --target ${{ matrix.toolchain.rust_host }}
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: configure git
run: git config --global --add safe.directory '*'
- uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive
# Most volatile cache
- name: restore ccache
uses: actions/cache/restore@v5
id: ccache-restore
with:
path: ~/.cache/ccache
key: ccache-${{ matrix.toolchain.host }}-${{ github.sha }}
restore-keys: ccache-${{ matrix.toolchain.host }}-
# Less volatile cache
- name: restore depends cache
uses: actions/cache/restore@v5
id: depends-restore
with:
path: contrib/depends/built
key: depends-${{ matrix.toolchain.host }}-${{ hashFiles('contrib/depends/packages/*') }}
restore-keys: depends-${{ matrix.toolchain.host }}-
- name: prepare w64-mingw32
if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' }}
run: |
update-alternatives --set ${{ matrix.toolchain.host }}-g++ $(which ${{ matrix.toolchain.host }}-g++-posix)
update-alternatives --set ${{ matrix.toolchain.host }}-gcc $(which ${{ matrix.toolchain.host }}-gcc-posix)
- uses: ./.github/actions/set-make-job-count
- name: build
run: |
${{env.CCACHE_SETTINGS}}
make depends target=${{ matrix.toolchain.host }} -j${{env.MAKE_JOB_COUNT}}
- name: save ccache
uses: actions/cache/save@v5
if: github.event_name != 'pull_request' && steps.ccache-restore.outputs.cache-hit != 'true'
with:
path: ~/.cache/ccache
key: ${{ steps.ccache-restore.outputs.cache-primary-key }}
- name: save depends cache
uses: actions/cache/save@v5
if: github.event_name != 'pull_request' && steps.depends-restore.outputs.cache-hit != 'true'
with:
path: contrib/depends/built
key: ${{ steps.depends-restore.outputs.cache-primary-key }}
- uses: actions/upload-artifact@v7
if: ${{ matrix.toolchain.host == 'x86_64-w64-mingw32' || matrix.toolchain.host == 'x86_64-apple-darwin' || matrix.toolchain.host == 'arm64-apple-darwin' || matrix.toolchain.host == 'x86_64-unknown-linux-gnu' }}
with:
name: ${{ matrix.toolchain.name }}
path: |
build/${{ matrix.toolchain.host }}/release/bin/monero-wallet-cli*
build/${{ matrix.toolchain.host }}/release/bin/monerod*