From 37138845e2424da835e54b5491725bbac7d0378f Mon Sep 17 00:00:00 2001 From: Hubert Bugaj Date: Fri, 4 Oct 2024 17:02:29 +0200 Subject: [PATCH] feat(ci): add codecov --- .github/workflows/codecov.yml | 35 +++++++++++++++++++++++++++++++++++ README.md | 4 +++- 2 files changed, 38 insertions(+), 1 deletion(-) 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 ddbbb6c..0027f6b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Filecoin Common Node API Specification +[![codecov](https://codecov.io/gh/ChainSafe/filecoin-common-node-api/graph/badge.svg?token=15C2O7Z4G6)](https://codecov.io/gh/ChainSafe/filecoin-common-node-api) + This repo is an appendix to the [Filecoin Common Node API FIP](https://github.com/filecoin-project/FIPs/pull/1027). # Spec @@ -45,4 +47,4 @@ $ cna-tool json-rpc capture --help Validate the spec, and perhaps captured calls ```console $ cna-tool openrpc validate --help -``` \ No newline at end of file +```