-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathaction.yml
More file actions
44 lines (43 loc) · 1.67 KB
/
action.yml
File metadata and controls
44 lines (43 loc) · 1.67 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
name: "Rust builds"
description: "Builds and tests rust code"
inputs:
toolchain:
required: true
description: "the Rust toolchain to use"
save-if:
required: false
description: "whether to save the cache (e.g. only on main)"
default: "true"
runs:
using: "composite"
steps:
- uses: dtolnay/rust-toolchain@3c5f7ea28cd621ae0bf5283f0e981fb97b8a7af9 # master
with:
toolchain: ${{ inputs.toolchain }}
- uses: Swatinem/rust-cache@e18b497796c12c097a38f9edb9d0641fb99eee32 # v2
with:
save-if: ${{ inputs.save-if }}
cache-bin: "false"
- name: Enable perf_event_open and kallsyms for tests
if: runner.os == 'Linux'
shell: bash
run: |
sudo sysctl kernel.perf_event_paranoid=1
sudo sysctl kernel.kptr_restrict=0
- name: Build and test
shell: bash
env:
RUSTFLAGS: "--cfg tokio_unstable -C force-frame-pointers=yes"
run: |
if [ "${{ inputs.toolchain }}" = nightly ]; then
rm -fv Cargo.lock
fi
# tokio's `taskdump` feature only compiles on linux aarch64/x86/x86_64.
# On macOS drop it from --all-features; leave everything else intact.
if [ "$RUNNER_OS" = "Linux" ]; then
# Raise locked-memory limit for large perf ring buffers
sudo prlimit --pid $$ --memlock=unlimited:unlimited
cargo test --all-targets --all-features
else
cargo test --all-targets --features __nonlinux_all_features
fi