-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
74 lines (68 loc) · 2.36 KB
/
Copy pathaction.yml
File metadata and controls
74 lines (68 loc) · 2.36 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
name: Configure Rust build environment
description: Verify the prebuilt toolchain and configure target-specific environment variables
author: Anthaathi
inputs:
crate:
description: Crate being built (apps/client or apps/edge)
required: false
default: apps/client
target:
description: Optional Rust compilation target
required: false
default: ""
mode:
description: Setup mode (standard or osxcross)
required: false
default: standard
runs:
using: composite
steps:
- name: Verify and configure prebuilt toolchain
shell: bash
env:
CRATE: ${{ inputs.crate }}
TARGET: ${{ inputs.target }}
MODE: ${{ inputs.mode }}
run: |
set -euo pipefail
cargo --version
rustc --version
if [ -n "$TARGET" ]; then
rustup target list --installed | grep -Fxq "$TARGET" || {
echo "Rust target $TARGET is missing from the prebuilt image" >&2
exit 1
}
fi
if [ "$MODE" = osxcross ]; then
command -v clang >/dev/null
command -v cmake >/dev/null
command -v xz >/dev/null
exit 0
fi
case "$TARGET" in
"")
if [ "$CRATE" = apps/client ]; then
pkg-config --exists gstreamer-1.0 gstreamer-base-1.0 xkbcommon
fi
;;
aarch64-unknown-linux-gnu)
command -v aarch64-linux-gnu-gcc >/dev/null
command -v aarch64-linux-gnu-g++ >/dev/null
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> "$GITHUB_ENV"
if [ "$CRATE" = apps/client ]; then
test -f /usr/lib/aarch64-linux-gnu/pkgconfig/gstreamer-1.0.pc
echo "PKG_CONFIG_ALLOW_CROSS=1" >> "$GITHUB_ENV"
echo "PKG_CONFIG_LIBDIR=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/share/pkgconfig" >> "$GITHUB_ENV"
fi
;;
x86_64-pc-windows-gnu)
command -v x86_64-w64-mingw32-gcc >/dev/null
command -v msibuild >/dev/null
echo "CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=x86_64-w64-mingw32-gcc" >> "$GITHUB_ENV"
echo "CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS=true" >> "$GITHUB_ENV"
;;
*)
echo "Unsupported prebuilt Rust target: $TARGET" >&2
exit 2
;;
esac