From ca0b326bb4ec6cc8fb5efd5c35642e67c1b798a5 Mon Sep 17 00:00:00 2001 From: Michal S Date: Wed, 7 Sep 2022 20:18:26 +0100 Subject: [PATCH] Add GH CI for Clippy and FMT --- .github/workflows/test.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..0ec4de0 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Lint Code +on: + workflow_dispatch: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + formatting: + name: cargo fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + components: rustfmt + - name: Format + uses: actions-rust-lang/rustfmt@v1.0.0 + clippy: + name: cargo clippy + runs-on: ubuntu-latest + container: ghcr.io/crystal-linux/crystal:latest + steps: + - uses: actions/checkout@v1 + - run: | + sudo pacman -Syu --needed --noconfirm + sudo pacman -S --noconfirm rust + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file