Skip to content

Commit 8659a83

Browse files
committed
add github actions to test linting
1 parent 364bd18 commit 8659a83

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

.github/workflows/tests.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
on: [push, pull_request]
2+
3+
name: Tests and linting
4+
5+
jobs:
6+
test:
7+
name: Test Suite
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: actions/cache@v4
12+
with:
13+
path: |
14+
~/.cargo/bin/
15+
~/.cargo/registry/index/
16+
~/.cargo/registry/cache/
17+
~/.cargo/git/db/
18+
target/
19+
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
20+
- uses: dtolnay/rust-toolchain@stable
21+
- run: cargo test
22+
23+
lints:
24+
name: Lints
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout sources
28+
uses: actions/checkout@v4
29+
30+
- name: Install stable toolchain
31+
uses: dtolnay/rust-toolchain@stable
32+
with:
33+
profile: minimal
34+
toolchain: stable
35+
components: rustfmt, clippy
36+
37+
- name: Run cargo fmt
38+
run: cargo fmt --all -- --check
39+
40+
- name: Run cargo clippy
41+
run: cargo clippy -- -D warnings

src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
extern crate flatbuffers;
22

3+
#[allow(unused_imports)]
4+
#[allow(clippy::all)]
5+
#[rustfmt::skip]
36
mod lrs_generated;
47

5-
use flatbuffers::WIPOffset;
68
pub use lrs_generated::*;
79

810
#[test]
911
fn read_and_write_lrs() {
12+
use flatbuffers::WIPOffset;
1013
let mut fbb = flatbuffers::FlatBufferBuilder::with_capacity(1024);
1114
let property = PropertyArgs {
1215
key: Some(fbb.create_string("some key")),

0 commit comments

Comments
 (0)