Repository navigation
94 lines (85 loc) · 3.4 KB
/
Copy pathcross.yml
File metadata and controls
94 lines (85 loc) · 3.4 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Cross
on:
workflow_call:
permissions:
statuses: write
jobs:
cross-linux:
name: Cross - ${{ matrix.target }}
runs-on: ubuntu-24.04
timeout-minutes: 45
env:
CARGO_INCREMENTAL: 0
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: (PR review) Set latest commit status as pending
if: ${{ github.event_name == 'pull_request_review' }}
uses: myrotvorets/set-commit-status-action@3730c0a348a2ace3c110851bed53331bc6406e9f # v2.0.1
with:
sha: ${{ github.event.review.commit_id }}
token: ${{ secrets.GITHUB_TOKEN }}
context: Cross
status: pending
- name: (PR review) Checkout PR branch
if: ${{ github.event_name == 'pull_request_review' }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.review.commit_id }}
- name: Checkout branch
if: ${{ github.event_name != 'pull_request_review' }}
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: "vector-debug-${{ matrix.target }}"
path: "./target/${{ matrix.target }}/debug/vector"
- name: (PR review) Set latest commit status as failed
uses: myrotvorets/set-commit-status-action@3730c0a348a2ace3c110851bed53331bc6406e9f # v2.0.1
if: failure() && github.event_name == 'pull_request_review'
with:
sha: ${{ steps.comment-branch.outputs.head_sha }}
token: ${{ secrets.GITHUB_TOKEN }}
context: Cross
status: 'failure'
update-pr-status:
name: (PR review) Signal result to PR
runs-on: ubuntu-24.04
timeout-minutes: 5
needs: cross-linux
if: needs.cross-linux.result == 'success' && github.event_name == 'pull_request_review'
steps:
- name: (PR review) Submit PR result as success
uses: myrotvorets/set-commit-status-action@3730c0a348a2ace3c110851bed53331bc6406e9f # v2.0.1
with:
sha: ${{ github.event.review.commit_id }}
token: ${{ secrets.GITHUB_TOKEN }}
context: Cross
status: 'success'