From 4da3a02daecf22bf9e12372f705d8a1326bbc7ed Mon Sep 17 00:00:00 2001 From: pscott Date: Tue, 19 Jan 2021 14:12:27 +0100 Subject: [PATCH 1/3] Deny lints from clippy --- .github/workflows/rust.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..abffcbf --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,36 @@ +name: Format, Clippy and Build + +on: + push: + branches: + - master + pull_request: + branches: + - master + + +env: + CARGO_TERM_COLOR: always + RUSTFLAGS: "-D warnings" + +jobs: + fmt: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Ensures everything is formatted properly. + run: cargo fmt --all -- --check + clippy: + runs-on: ubuntu-latest + needs: fmt + steps: + - uses: actions/checkout@v2 + - name: Set of lints used by default to make code cleaner. + run: cargo clippy --all-targets --all-features -- -D clippy::all + build: + runs-on: ubuntu-latest + needs: clippy + steps: + - uses: actions/checkout@v2 + - name: Ensures the code builds. + run: cargo build From eeea09d1e341e5be9ef240e046d3b5e1f53d5cf3 Mon Sep 17 00:00:00 2001 From: pscott Date: Tue, 19 Jan 2021 14:13:04 +0100 Subject: [PATCH 2/3] Ignore Cargo.lock and .vscode --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index ea8c4bf..c640ca5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /target +Cargo.lock +.vscode From 75d46783deb993b0b5c9ff982c0690b1505d437d Mon Sep 17 00:00:00 2001 From: pscott Date: Tue, 19 Jan 2021 14:21:30 +0100 Subject: [PATCH 3/3] Add tests to CI --- .github/workflows/rust.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index abffcbf..68c945b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -34,3 +34,10 @@ jobs: - uses: actions/checkout@v2 - name: Ensures the code builds. run: cargo build + test: + runs-on: ubuntu-latest + needs: build + steps: + uses: actions/checkout@v2 + name: Ensures all tests pass. + run: cargo test --all-targets --all-features