From 3c314f10af6eb4dac7accdc56ae2b67981a9676a Mon Sep 17 00:00:00 2001 From: Hubert Date: Mon, 7 Oct 2024 17:18:13 +0200 Subject: [PATCH] feat(ci): add code coverage (#36) --- .github/workflows/codecov.yml | 35 +++++++++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 36 insertions(+) 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..ebb854c --- /dev/null +++ b/.github/workflows/codecov.yml @@ -0,0 +1,35 @@ +name: Code coverage +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: "${{ github.ref != 'refs/heads/main' }}" +"on": + workflow_dispatch: + merge_group: + pull_request: + branches: + - main + push: + branches: + - main + +jobs: + codedov: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: taiki-e/install-action@cargo-llvm-cov + - run: cargo llvm-cov --all-features --lcov --output-path lcov.info + env: + RUSTC_WRAPPER: + - uses: actions/upload-artifact@v4 + with: + name: lcov.info + path: lcov.info + if-no-files-found: error + - name: Upload to codecov + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: | + curl -Os https://uploader.codecov.io/latest/linux/codecov + chmod +x codecov + ./codecov -f lcov.info -Z diff --git a/README.md b/README.md index 6b576b0..36882f2 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Rust](https://github.com/LesnyRumcajs/wakey/actions/workflows/rust.yml/badge.svg)](https://github.com/LesnyRumcajs/wakey/actions/workflows/rust.yml) [![Crates.io](https://img.shields.io/crates/v/wakey.svg)](https://crates.io/crates/wakey) [![docs.rs](https://img.shields.io/badge/api-rustdoc-blue.svg)](https://docs.rs/wakey) +[![codecov](https://codecov.io/github/LesnyRumcajs/wakey/graph/badge.svg?token=PXR2yHWzvJ)](https://codecov.io/github/LesnyRumcajs/wakey) Library for managing Wake-on-LAN packets. It supports: * creating magic packets,