diff --git a/.github/actions/rust_crate/action.yaml b/.github/actions/rust_crate/action.yaml index 6e450c1..dadb07d 100644 --- a/.github/actions/rust_crate/action.yaml +++ b/.github/actions/rust_crate/action.yaml @@ -2,6 +2,9 @@ name: Rust Crate Workflow description: Build and test your Rust crate inputs: + codecov_token: + required: true + description: The codecov token used to upload coverage reports. working_directory: required: false default: "." @@ -18,4 +21,11 @@ runs: - name: Test working-directory: ${{ inputs.working_directory }} shell: ${{ inputs.shell }} - run: cargo test --verbose + run: | + cargo install cargo-llvm-cov + cargo llvm-cov --lcov --output-path lcov.info + + - name: Upload Coverage + uses: codecov/codecov-action@v3 + with: + token: ${{ inputs.codecov_token }} diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 7f80806..4c36e8d 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -2,6 +2,7 @@ name: ci on: pull_request: + push: branches: - main @@ -56,6 +57,7 @@ jobs: - name: 🦀 Build ${{ matrix.package }} uses: ./.github/actions/rust_crate with: + codecov_token: ${{ secrets.CODECOV_TOKEN }} working_directory: ${{ matrix.crate }} ci: diff --git a/.gitignore b/.gitignore index 1aaec94..b75e711 100644 --- a/.gitignore +++ b/.gitignore @@ -14,4 +14,7 @@ Cargo.lock *.pdb # Cache directory from updater cli. -updater_cache \ No newline at end of file +updater_cache + +# Test related +lcov.info \ No newline at end of file