Skip to content

Commit

Permalink
add github actions to test linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristramg committed Feb 21, 2024
1 parent 364bd18 commit 98ba06d
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
51 changes: 51 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
on: [push, pull_request]

name: Tests and linting

jobs:
test:
name: Test Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: actions-rs/cargo@v1
with:
command: test

lints:
name: Lints
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2

- name: Install stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt, clippy

- name: Run cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- name: Run cargo clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
5 changes: 4 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
extern crate flatbuffers;

#[allow(unused_imports)]
#[allow(clippy::all)]
#[rustfmt::skip]
mod lrs_generated;

use flatbuffers::WIPOffset;
pub use lrs_generated::*;

#[test]
fn read_and_write_lrs() {
use flatbuffers::WIPOffset;
let mut fbb = flatbuffers::FlatBufferBuilder::with_capacity(1024);
let property = PropertyArgs {
key: Some(fbb.create_string("some key")),
Expand Down

0 comments on commit 98ba06d

Please sign in to comment.