Repository navigation
62 lines (57 loc) · 2.05 KB
/
Copy pathcross.yml
File metadata and controls
62 lines (57 loc) · 2.05 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
name: Cross
on:
workflow_call:
inputs:
ref:
description: "Git ref to checkout"
required: false
type: string
permissions:
contents: read
jobs:
cross-linux:
name: Cross - ${{ matrix.target }}
runs-on: ubuntu-24.04
timeout-minutes: 60
env:
CARGO_INCREMENTAL: 0
CARGO_PROFILE_RELEASE_LTO: thin # fat LTO OOMs/timeouts on standard 16GB runners; thin is sufficient to verify linking
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl
- aarch64-unknown-linux-gnu
- aarch64-unknown-linux-musl
- armv7-unknown-linux-gnueabihf
- armv7-unknown-linux-musleabihf
- arm-unknown-linux-gnueabi
- arm-unknown-linux-musleabi
steps:
- name: Checkout branch
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.ref }}
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
name: Cache Cargo registry + index
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- run: echo "::add-matcher::.github/matchers/rust.json"
- run: |
rustup target add x86_64-unknown-linux-gnu
cargo install cross --version 0.2.4 --force --locked
# Why is this build, not check? Because we need to make sure the linking phase works.
# aarch64 and musl in particular are notoriously hard to link.
# While it may be tempting to slot a `check` in here for quickness, please don't.
- run: make cross-build-${{ matrix.target }}
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: "vector-${{ matrix.target }}"
path: "./target/${{ matrix.target }}/release/vector"