-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (55 loc) · 1.54 KB
/
rust.yml
File metadata and controls
68 lines (55 loc) · 1.54 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
name: Rust Build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
statuses: write
env:
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUST_BACKTRACE: short
RUSTFLAGS: "-D warnings"
RUSTUP_MAX_RETRIES: 10
# Cancel previous runs on new push
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Install Rust nightly
uses: dtolnay/rust-toolchain@nightly
with:
components: llvm-tools-preview
- name: Setup sccache
id: sccache
uses: mozilla-actions/sccache-action@v0.0.4
continue-on-error: true
- name: Configure sccache
if: steps.sccache.outcome == 'success'
run: |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
- name: Cache Cargo
uses: Swatinem/rust-cache@v2
with:
shared-key: "build"
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: Build with nightly features
run: |
echo "Using Rust nightly for zero-cost GAT abstractions"
rustc --version
cargo build --verbose --all-features --workspace
- name: Build release
run: cargo build --release --verbose --all-features --workspace
- name: sccache stats
if: always()
run: sccache --show-stats || echo "sccache not available"
continue-on-error: true