@@ -10,6 +10,7 @@ enum OperatingSystem {
10
10
interface ProfileData {
11
11
os : OperatingSystem ;
12
12
target : string ;
13
+ cross ?: boolean ;
13
14
runTests ?: boolean ;
14
15
}
15
16
@@ -40,6 +41,7 @@ const profileDataItems: ProfileData[] = [{
40
41
target : "aarch64-unknown-linux-musl" ,
41
42
} , {
42
43
os : OperatingSystem . Linux ,
44
+ cross : true ,
43
45
target : "riscv64gc-unknown-linux-gnu" ,
44
46
} ] ;
45
47
const profiles = profileDataItems . map ( ( profile ) => {
@@ -72,6 +74,7 @@ const ci = {
72
74
os : profile . os ,
73
75
run_tests : ( profile . runTests ?? false ) . toString ( ) ,
74
76
target : profile . target ,
77
+ cross : ( profile . cross ?? false ) . toString ( ) ,
75
78
} ) ) ,
76
79
} ,
77
80
} ,
@@ -127,33 +130,42 @@ const ci = {
127
130
] . join ( "\n" ) ,
128
131
} ,
129
132
{
130
- name : "Setup (Linux riscv64gc) " ,
131
- if : "matrix.config.target == 'riscv64gc-unknown-linux-gnu '" ,
133
+ name : "Setup cross " ,
134
+ if : "matrix.config.cross == 'true '" ,
132
135
run : [
133
- "sudo apt update" ,
134
- "sudo apt-get install -y gcc-riscv64-linux-gnu g++-riscv64-linux-gnu libc6-dev-riscv64-cross" ,
135
- "rustup target add riscv64gc-unknown-linux-gnu" ,
136
- "which riscv64-unknown-linux-gnu-gcc"
136
+ "cargo install cross --git https://github.com/cross-rs/cross --rev 88f49ff79e777bef6d3564531636ee4d3cc2f8d2" ,
137
137
] . join ( "\n" ) ,
138
138
} ,
139
139
{
140
140
name : "Build (Debug)" ,
141
- if : "!startsWith(github.ref, 'refs/tags/')" ,
141
+ if : "matrix.config.cross != 'true' && !startsWith(github.ref, 'refs/tags/')" ,
142
142
env : {
143
143
"CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER" : "aarch64-linux-gnu-gcc" ,
144
- "CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER" : "riscv64-unknown-linux-gnu-gcc" ,
145
144
} ,
146
145
run : "cargo build --locked --all-targets --target ${{matrix.config.target}}" ,
147
146
} ,
148
147
{
149
148
name : "Build release" ,
150
- if : "startsWith(github.ref, 'refs/tags/')" ,
149
+ if : "matrix.config.cross != 'true' && startsWith(github.ref, 'refs/tags/')" ,
151
150
env : {
152
151
"CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER" : "aarch64-linux-gnu-gcc" ,
153
- "CARGO_TARGET_RISCV64GC_UNKNOWN_LINUX_GNU_LINKER" : "riscv64-unknown-linux-gnu-gcc" ,
154
152
} ,
155
153
run : "cargo build --locked --all-targets --target ${{matrix.config.target}} --release" ,
156
154
} ,
155
+ {
156
+ name : "Build cross (Debug)" ,
157
+ if : "matrix.config.cross == 'true' && !startsWith(github.ref, 'refs/tags/')" ,
158
+ run : [
159
+ "cross build --locked --target ${{matrix.config.target}}" ,
160
+ ] . join ( "\n" ) ,
161
+ } ,
162
+ {
163
+ name : "Build cross (Release)" ,
164
+ if : "matrix.config.cross == 'true' && startsWith(github.ref, 'refs/tags/')" ,
165
+ run : [
166
+ "cross build --locked --target ${{matrix.config.target}} --release" ,
167
+ ] . join ( "\n" ) ,
168
+ } ,
157
169
{
158
170
name : "Lint" ,
159
171
if :
0 commit comments