Skip to content

Commit 44a5dea

Browse files
authored
Create rust.yml
1 parent ee799fd commit 44a5dea

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/rust.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Rust
20+
uses: dtolnay/rust-toolchain@stable
21+
with:
22+
targets: i686-unknown-linux-gnu
23+
24+
- name: Cache cargo registry
25+
uses: actions/cache@v3
26+
with:
27+
path: ~/.cargo/registry
28+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
29+
30+
- name: Cache cargo index
31+
uses: actions/cache@v3
32+
with:
33+
path: ~/.cargo/git
34+
key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}
35+
36+
- name: Cache cargo build
37+
uses: actions/cache@v3
38+
with:
39+
path: target
40+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
41+
42+
- name: Build
43+
run: cargo build --verbose
44+
45+
- name: Run tests
46+
run: cargo test --verbose
47+
48+
- name: Run clippy
49+
run: cargo clippy --all-targets -- -D warnings

0 commit comments

Comments
 (0)