From 2531fcb850c5320f1de8565f65b50e5363894bce Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Mon, 9 Dec 2024 16:08:10 +0530 Subject: [PATCH 1/2] ci: lint, test and coverage report --- .github/workflows/coverage.yaml | 57 ++++++++++++++++++++++++++++++ .github/workflows/lint.yaml | 61 --------------------------------- README.md | 1 + 3 files changed, 58 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/coverage.yaml delete mode 100644 .github/workflows/lint.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 000000000..eb5a46da4 --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,57 @@ +on: + pull_request: + paths-ignore: + - "docs/**" + - "helm/**" + - "assets/**" + - "**.md" + push: + branches: + - main + +name: Lint, Test and Coverage Report +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: dtolnay/rust-toolchain@stable + with: + components: clippy + + - uses: Swatinem/rust-cache@v2 + with: + shared-key: ${{ runner.os }}-cargo + + - uses: taiki-e/install-action@v2 + with: + tool: cargo-hack, cargo-llvm-cov, nextest + + - name: Check with clippy + run: cargo hack clippy --verbose --each-feature --no-dev-deps -- -D warnings + + - name: Check docs + run: cargo hack doc --verbose --no-deps --each-feature --no-dev-deps + + - name: Doctests + run: cargo hack --each-feature test --doc + + - name: Tests + run: cargo hack --each-feature llvm-cov --no-report nextest + + - name: Genrate coverage report + run: cargo llvm-cov report --lcov --output-path coverage.lcov + + - name: Upload Coverage Report + uses: coverallsapp/github-action@v2.2.3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + file: ./coverage.lcov + parallel: true + flag-name: run-${{ matrix.os }}-cargo + + - name: Finish Coverage Report + uses: coverallsapp/github-action@v2.2.3 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + parallel-finished: true diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml deleted file mode 100644 index 4f2578cf5..000000000 --- a/.github/workflows/lint.yaml +++ /dev/null @@ -1,61 +0,0 @@ -name: Linter - -on: - pull_request: - paths-ignore: - - 'docs/**' - - 'helm/**' - - 'assets/**' - - '**.md' - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - -jobs: - - unit-tests: - name: Unit tests - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: test - - fmt: - name: Rust fmt check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - clippy: - name: Cargo Clippy check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - run: rustup component add clippy - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings diff --git a/README.md b/README.md index 2554e1b2f..bbf787336 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ [![Slack](https://img.shields.io/badge/slack-brightgreen.svg?logo=slack&label=Community&style=flat&color=%2373DC8C&)](https://logg.ing/community) [![Docs](https://img.shields.io/badge/stable%20docs-parseable.io%2Fdocs-brightgreen?style=flat&color=%2373DC8C&label=Docs)](https://logg.ing/docs) [![Build](https://img.shields.io/github/checks-status/parseablehq/parseable/main?style=flat&color=%2373DC8C&label=Checks)](https://github.com/parseablehq/parseable/actions) +[![Coverage Status](https://coveralls.io/repos/github/parseablehq/parseable/badge.svg?branch=main)](https://coveralls.io/github/parseablehq/parseable?branch=main) [Key Concepts](https://www.parseable.io/docs/concepts) | [Features](https://github.com/parseablehq/parseable#rocket-highlights) | [Documentation](https://www.parseable.io/docs) | [Demo](https://demo.parseable.com/login?q=eyJ1c2VybmFtZSI6ImFkbWluIiwicGFzc3dvcmQiOiJhZG1pbiJ9) | [Integrations](https://www.parseable.io/docs/category/integrations) | [FAQ](https://www.parseable.io/docs/faq) From 351c7ddbd9bb447a4a1e9a33c2c1508da0e5ad65 Mon Sep 17 00:00:00 2001 From: Devdutt Shenoi Date: Mon, 9 Dec 2024 20:22:04 +0530 Subject: [PATCH 2/2] remove status from README Signed-off-by: Devdutt Shenoi --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index bbf787336..2554e1b2f 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,6 @@ [![Slack](https://img.shields.io/badge/slack-brightgreen.svg?logo=slack&label=Community&style=flat&color=%2373DC8C&)](https://logg.ing/community) [![Docs](https://img.shields.io/badge/stable%20docs-parseable.io%2Fdocs-brightgreen?style=flat&color=%2373DC8C&label=Docs)](https://logg.ing/docs) [![Build](https://img.shields.io/github/checks-status/parseablehq/parseable/main?style=flat&color=%2373DC8C&label=Checks)](https://github.com/parseablehq/parseable/actions) -[![Coverage Status](https://coveralls.io/repos/github/parseablehq/parseable/badge.svg?branch=main)](https://coveralls.io/github/parseablehq/parseable?branch=main) [Key Concepts](https://www.parseable.io/docs/concepts) | [Features](https://github.com/parseablehq/parseable#rocket-highlights) | [Documentation](https://www.parseable.io/docs) | [Demo](https://demo.parseable.com/login?q=eyJ1c2VybmFtZSI6ImFkbWluIiwicGFzc3dvcmQiOiJhZG1pbiJ9) | [Integrations](https://www.parseable.io/docs/category/integrations) | [FAQ](https://www.parseable.io/docs/faq)