# Code coverage generation via cargo-tarpaulin, and uploaded to codecov. name: codecov on: workflow_dispatch: pull_request: push: branches: - master env: CARGO_INCREMENTAL: 0 jobs: pre_job: runs-on: ubuntu-latest outputs: should_skip: ${{ steps.skip_check.outputs.should_skip }} steps: - id: skip_check uses: fkirc/skip-duplicate-actions@38c3738dcac87b41e2b7038775457756c793566e # https://github.com/fkirc/skip-duplicate-actions/commit/38c3738dcac87b41e2b7038775457756c793566e with: concurrent_skipping: "same_content_newer" skip_after_successful_duplicate: "false" do_not_skip: '["workflow_dispatch", "push"]' coverage: needs: pre_job if: ${{ needs.pre_job.outputs.should_skip != 'true' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions-rs/toolchain@88dc2356392166efad76775c878094f4e83ff746 # https://github.com/actions-rs/toolchain/commit/88dc2356392166efad76775c878094f4e83ff746 with: profile: minimal toolchain: stable override: true - uses: Swatinem/rust-cache@cb2cf0cc7c5198d3364b9630e2c3d457f160790c # 1.4.0 with: key: ${{ matrix.triple.target }} - name: Install cargo-llvm-cov run: | rustup component add llvm-tools-preview cargo install cargo-llvm-cov --version 0.3.0 --locked - name: Generate code coverage run: | cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info - name: Upload to codecov.io uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # 2.1.0 with: files: lcov.info fail_ci_if_error: true