-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (42 loc) · 1.5 KB
/
rust.yaml
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
name: Rust
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
workflow_dispatch:
# Automatically cancel in-progress actions on the same branch
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }}
cancel-in-progress: true
env:
# get correct commit sha for pull requests as well
COMMIT_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
target:
- rust: aarch64-unknown-linux-musl
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: rui314/setup-mold@2e332a0b602c2fc65d2d3995941b1b29a5f554a0 # v1.0.0
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target.rust }}
- uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.0.0
with:
cache-all-crates: "true"
cache-on-failure: "true"
# nix dev shell setup
- uses: DeterminateSystems/nix-installer-action@v14
- uses: cachix/cachix-action@18cf96c7c98e048e10a83abd92116114cd8504be # v14
with: { name: "nix-community" }
- uses: DeterminateSystems/magic-nix-cache-action@v8
- name: test
run: nix develop -c cargo test
- name: build
env:
TARGET_CC: clang
run: nix develop .#${{ matrix.target.rust }} -c cargo build --target ${{ matrix.target.rust }} --release