From f47b3f09e7bfde6b703c001bd89f177be78b8287 Mon Sep 17 00:00:00 2001 From: Kaan Barmore-Genc Date: Mon, 22 Aug 2022 22:12:57 -0400 Subject: [PATCH] add lint and test actions --- .github/workflows/lint.yml | 17 +++++++++++++++++ .github/workflows/test.yml | 25 +++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..41a4755 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,17 @@ +on: push +name: lint checks +jobs: + rust_lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: rustup component add clippy + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features + rust_format_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: cargo fmt --all --check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ed71c7d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +name: test +on: + push: + branches: + - "main" + pull_request: + branches: + - "*" +jobs: + test: + name: run tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install Rust + run: rustup toolchain install stable --component llvm-tools-preview + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate code coverage + run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + files: lcov.info + fail_ci_if_error: true