diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..68c945b --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,43 @@ +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 + test: + runs-on: ubuntu-latest + needs: build + steps: + uses: actions/checkout@v2 + name: Ensures all tests pass. + run: cargo test --all-targets --all-features diff --git a/.gitignore b/.gitignore index ea8c4bf..c640ca5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /target +Cargo.lock +.vscode