Skip to content

Instantly share code, notes, and snippets.

@rngadam
Created September 4, 2024 17:52
Show Gist options
  • Save rngadam/f3b547c65b0c8eb02d868887fb94eb8f to your computer and use it in GitHub Desktop.
Save rngadam/f3b547c65b0c8eb02d868887fb94eb8f to your computer and use it in GitHub Desktop.
codecov

To create a codecov token (free use for opensource repos):

      - name: Checkout
        uses: actions/checkout@v3

      - name: Install Rust toolchain
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: ${{ env.RUST_VERSION }}

      - name: Cache cargo resources
        uses: Swatinem/rust-cache@v2
        
      - name: Install cargo-llvm-cov
        uses: taiki-e/install-action@cargo-llvm-cov
        
      - name: Test Linux and macOS
        if: ${{ runner.os != 'Windows' }}
        run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info

      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v3
        with:
          token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
          files: lcov.info
          fail_ci_if_error: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment