4
4
workflow_dispatch :
5
5
6
6
jobs :
7
- build_native :
8
- runs-on : ${{ matrix.os }}
7
+ build_macos :
8
+ if : github.repository_owner == 'viamrobotics'
9
+ runs-on : [self-hosted, ARM64, macOS]
9
10
strategy :
10
11
fail-fast : false
11
12
matrix :
12
13
include :
13
- - os : macos-latest
14
- arch : arm64
15
- target : aarch64-apple-darwin
14
+ - target : aarch64-apple-darwin
16
15
platform : macosx_arm64
17
- - os : macos-latest
18
- arch : x86_64
19
- target : x86_64-apple-darwin
16
+ - target : x86_64-apple-darwin
20
17
platform : macosx_x86_64
21
18
steps :
22
- - uses : actions/checkout@v2
19
+ - uses : actions/checkout@v3
23
20
- name : Setup rust toolchain
24
21
uses : actions-rs/toolchain@v1
25
22
with :
@@ -40,43 +37,42 @@ jobs:
40
37
name : builds
41
38
path : builds
42
39
43
- build_in_container :
44
- runs-on : ${{ matrix.arch }}
40
+ build_linux :
41
+ if : github.repository_owner == 'viamrobotics'
42
+ runs-on : [self-hosted, x64]
45
43
container :
46
- image : ${{ matrix.image }}
47
- options : ${{ matrix.opts }}
44
+ image : ghcr.io/viamrobotics/canon:amd64-cache
45
+ options : -v /var/run/docker.sock:/var/run/docker.sock -v ${{ github.workspace }}:/project -w /project
48
46
strategy :
49
47
fail-fast : false
50
48
matrix :
51
49
include :
52
- - arch : [arm64, qemu-host]
53
- target : aarch64-unknown-linux-gnu
50
+ - target : aarch64-unknown-linux-gnu
54
51
platform : linux_aarch64
55
- ext : so
56
- image : ' ghcr.io/viamrobotics/canon:arm64-cache'
57
- opts : ' --platform linux/arm64'
58
- - arch : [x64, qemu-host]
59
- target : x86_64-unknown-linux-gnu
52
+ cross : true
53
+ - target : x86_64-unknown-linux-gnu
60
54
platform : linux_x86_64
61
- ext : so
62
- image : ' ghcr.io/viamrobotics/canon:amd64-cache'
63
- opts : ' --platform linux/amd64'
55
+ cross : false
64
56
steps :
65
- - uses : actions/checkout@v2
57
+ - uses : actions/checkout@v3
66
58
- name : Setup rust toolchain
67
59
uses : actions-rs/toolchain@v1
68
60
with :
69
61
toolchain : stable
70
62
target : ${{ matrix.target }}
63
+ override : true
71
64
- name : Setup build directory
72
65
run : mkdir builds
73
66
- name : Build
74
67
uses : actions-rs/cargo@v1
75
68
with :
76
69
command : build
77
70
args : --release --target=${{ matrix.target }}
71
+ use-cross : ${{ matrix.cross }}
72
+ env :
73
+ CROSS_CONTAINER_IN_CONTAINER : ${{ matrix.cross }}
78
74
- name : Copy
79
- run : cp target/${{ matrix.target }}/release/libviam_rust_utils.${{ matrix.ext }} builds/libviam_rust_utils-${{ matrix.platform }}.${{ matrix.ext }}
75
+ run : cp target/${{ matrix.target }}/release/libviam_rust_utils.so builds/libviam_rust_utils-${{ matrix.platform }}.so
80
76
- name : Upload artifacts
81
77
uses : actions/upload-artifact@v3
82
78
with :
0 commit comments