-
Notifications
You must be signed in to change notification settings - Fork 136
98 lines (86 loc) · 2.54 KB
/
cross.yaml
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
name: Cross Compile Check
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
pull_request_review:
types: [submitted]
branches: [bot/versioning]
jobs:
cross_compile_64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.70.0
override: true
components: cross
- name: Install cargo-cross
run: cargo install cross
- name: Cross Compile 64-bit
run: |
./sv2-rpi.sh jd_client 64
./sv2-rpi.sh jd_server 64
./sv2-rpi.sh mining_proxy_sv2 64
./sv2-rpi.sh pool_sv2 64
./sv2-rpi.sh translator_sv2 64
- name: Check artifacts
run: |
arch="aarch64-unknown-linux-gnu"
bin_dir="target/$arch/release"
tar_dir="tar"
artifacts=("jd_client" "jd_server" "mining_proxy_sv2" "pool_sv2" "translator_sv2")
for file in "${artifacts[@]}"; do
bin_path="$bin_dir/$file"
if [ ! -e "$bin_path" ]; then
echo "Binary file $bin_path does not exist."
exit 1
fi
tar_path="$tar_dir/$file-$arch.tar.gz"
if [ ! -e "$tar_path" ]; then
echo "File $tar_path does not exist."
exit 1
fi
done
cross_compile_32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.70.0
override: true
components: cross
- name: Cross Compile 32-bit
run: |
./sv2-rpi.sh jd_client 32
./sv2-rpi.sh jd_server 32
./sv2-rpi.sh mining_proxy_sv2 32
./sv2-rpi.sh pool_sv2 32
./sv2-rpi.sh translator_sv2 32
- name: Check artifacts
run: |
arch="arm-unknown-linux-gnueabi"
bin_dir="target/$arch/release"
tar_dir="tar"
artifacts=("jd_client" "jd_server" "mining_proxy_sv2" "pool_sv2" "translator_sv2")
for file in "${artifacts[@]}"; do
bin_path="$bin_dir/$file"
if [ ! -e "$bin_path" ]; then
echo "Binary file $bin_path does not exist."
exit 1
fi
tar_path="$tar_dir/$file-$arch.tar.gz"
if [ ! -e "$tar_path" ]; then
echo "File $tar_path does not exist."
exit 1
fi
done