-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (50 loc) · 1.52 KB
/
rust.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
name: Rust
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
CARGO_TERM_COLOR: always
jobs:
build_and_test:
runs-on: ["${{ matrix.distro }}", "${{ matrix.arch }}"]
name: Build on ${{ matrix.distro }} ${{ matrix.arch }}
# @@TODO: add back `linux/x64` once the LLVM installation becomes available
strategy:
matrix:
include:
- arch: arm64
distro: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Cache LLVM
id: cache-llvm
uses: actions/cache@v2
with:
path: ./llvm
key: llvm-18
- name: Install LLVM
uses: KyleMayes/install-llvm-action@v2
with:
version: "18.1.4"
cached: ${{ steps.cache-llvm.outputs.cache-hit }}
- name: Install Rust nightly
run: |
rustup toolchain install nightly
rustup component add clippy --toolchain nightly
rustup component add rustfmt --toolchain nightly
rustup default nightly
- name: Dependency caching
uses: Swatinem/rust-cache@v2
- name: LLVM location
run: |
echo $LLVM_PATH
$LLVM_PATH/bin/llvm-config --version
- name: Run tests
run: "LLVM_SYS_181_PREFIX=$LLVM_PATH cargo test --all --verbose"
- name: Run clippy
run: "LLVM_SYS_181_PREFIX=$LLVM_PATH cargo clippy --all -- -D warnings"
- name: Check formatting
run: "cargo fmt --all -- --check"