-
Notifications
You must be signed in to change notification settings - Fork 203
97 lines (83 loc) · 2.83 KB
/
build.yml
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
95
96
97
name: "Build nox binary"
on:
workflow_call:
inputs:
ref:
description: "git ref to checkout to"
type: string
default: "master"
cargo-dependencies:
description: "Cargo dependencies map"
type: string
default: "null"
outputs:
# compatibility output
rust-peer-sha:
description: "nox sha256 hash"
value: ${{ jobs.build.outputs.sha256 }}
nox-sha:
description: "nox sha256 hash"
value: ${{ jobs.build.outputs.sha256 }}
jobs:
build:
name: "Build nox (${{ matrix.arch }})"
runs-on: builder
timeout-minutes: 60
env: ${{ matrix.env }}
outputs:
sha256: "${{ steps.sha.outputs.sha256 }}"
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
env:
RUSTFLAGS: "-D warnings --cfg tokio_unstable"
- arch: aarch64
env:
RUSTFLAGS: "-D warnings --cfg tokio_unstable"
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CC_aarch64_unknown_linux_gnu: aarch64-linux-gnu-gcc
CXX_aarch64_unknown_linux_gnu: aarch64-linux-gnu-g++
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
repository: fluencelabs/nox
ref: ${{ inputs.ref }}
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1.4
- name: Get PR labels
id: labels
uses: joerick/pr-labels-action@v1.0.7
- name: Set profile
id: profile
run: |
if [[ -n "$GITHUB_PR_LABEL_PROFILING" ]]; then
echo "profile=profiling" >> $GITHUB_OUTPUT
echo "flags=--profile=profiling --features particle-node/dhat-heap" >> $GITHUB_OUTPUT
else
echo "profile=release" >> $GITHUB_OUTPUT
echo "flags=--profile=release" >> $GITHUB_OUTPUT
fi
- name: Set dependencies
if: inputs.cargo-dependencies != 'null'
uses: fluencelabs/github-actions/cargo-set-dependency@main
with:
dependencies: ${{ inputs.cargo-dependencies }}
- name: Generate snapshot version
id: version
uses: fluencelabs/github-actions/generate-snapshot-id@main
- name: Set version
id: snapshot
uses: fluencelabs/github-actions/cargo-publish-snapshot@main
with:
id: ${{ steps.version.outputs.id }}
publish: false
- name: Run cargo build
run: cargo build ${{ steps.profile.outputs.flags }} -p nox --target ${{ matrix.arch }}-unknown-linux-gnu
- name: Upload nox binary
uses: actions/upload-artifact@v3
with:
name: nox-${{ matrix.arch }}
path: target/${{ matrix.arch }}-unknown-linux-gnu/${{ steps.profile.outputs.profile }}/nox