From 8f08e79a862c23512150ba792d18a1eae6a6a496 Mon Sep 17 00:00:00 2001 From: Augustinas Bacvinka Date: Fri, 16 Dec 2022 15:26:25 +0200 Subject: [PATCH 1/2] ci: codecov and badges --- .github/workflows/codecov.yml | 38 +++++++++++++++++++++++++++++++++++ .github/workflows/main.yml | 2 +- .github/workflows/release.yml | 4 ++-- README.md | 11 ++++++++++ 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/codecov.yml diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml new file mode 100644 index 0000000..8fe2177 --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,38 @@ +# TODO: pull_request is only for testing, will be removed once coverage and badges are configured in PR. +on: + pull_request: + push: + branches: + - main + +name: Codecov + +jobs: + test: + name: Test + env: + RUSTFLAGS: -C instrument-coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: llvm-tools-preview + - uses: actions-rs/cargo@v1 + continue-on-error: true + - run: | + cargo install grcov; + cargo test --all-features; + mkdir /tmp/cov; + grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o /tmp/cov/tests.lcov; + - uses: codecov/codecov-action@v3 + with: + directory: /tmp/cov/ + name: overwatch-codecov + fail_ci_if_error: true + diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 51596f9..9929570 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -71,4 +71,4 @@ jobs: continue-on-error: false with: command: clippy - args: -- --deny warnings \ No newline at end of file + args: -- --deny warnings diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f51dcb3..3034495 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,7 +3,7 @@ on: tags: - v*.*.* -name: CI +name: Release jobs: release: @@ -15,4 +15,4 @@ jobs: override: true - uses: katyo/publish-crates@v1 with: - registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/README.md b/README.md index d71538f..e46d87b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,16 @@ # Overwatch +[![MIT licensed][mit-badge]][mit-url] +[![Build Status][actions-badge]][actions-url] +[![Codecov Status][codecov-badge]][codecov-url] + +[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg +[mit-url]: https://github.com/logos-co/Overwatch/blob/master/LICENSE +[actions-badge]: https://github.com/logos-co/Overwatch/workflows/CI/badge.svg +[actions-url]: https://github.com/logos-co/Overwatch/actions/workflows/main.yml?query=workflow%3ACI+branch%3Amain +[codecov-badge]: https://codecov.io/github/logos-co/Overwatch/branch/main/graph/badge.svg?token=H4CQWRUCUS +[codecov-url]: https://codecov.io/github/logos-co/Overwatch + Overwatch is a framework to easily construct applications that requires of several independent parts that needs communication between them. Everything is self-contained, and it matches somewhat the advantages of microservices. From 8fe8d703b26e1035bc4faa8da6f614dd564aead9 Mon Sep 17 00:00:00 2001 From: Augustinas Bacvinka Date: Fri, 16 Dec 2022 15:44:05 +0200 Subject: [PATCH 2/2] Remove codecoverage for PR --- .github/workflows/codecov.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 8fe2177..af52c60 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -1,6 +1,4 @@ -# TODO: pull_request is only for testing, will be removed once coverage and badges are configured in PR. on: - pull_request: push: branches: - main