on: pull_request: types: [opened, synchronize, reopened, ready_for_review] push: branches: - "main" - "develop" workflow_dispatch: name: Code coverage env: RUST_TOOLCHAIN: nightly-2022-07-14 jobs: coverage: if: github.event.pull_request.draft == false runs-on: ubuntu-latest-8-cores timeout-minutes: 60 steps: - uses: actions/checkout@v3 - uses: arduino/setup-protoc@v1 - name: Install toolchain uses: dtolnay/rust-toolchain@master with: toolchain: ${{ env.RUST_TOOLCHAIN }} components: llvm-tools-preview - name: Rust Cache uses: Swatinem/rust-cache@v2 - name: Cleanup disk uses: curoky/cleanup-disk-action@v2.0 with: retain: 'rust' - name: Install latest nextest release uses: taiki-e/install-action@nextest - name: Install cargo-llvm-cov uses: taiki-e/install-action@cargo-llvm-cov - name: Collect coverage data run: cargo llvm-cov nextest --workspace --lcov --output-path lcov.info env: RUST_BACKTRACE: 1 CARGO_INCREMENTAL: 0 GT_S3_BUCKET: ${{ secrets.S3_BUCKET }} GT_S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} GT_S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} UNITTEST_LOG_DIR: "__unittest_logs" - name: Codecov upload uses: codecov/codecov-action@v2 with: token: ${{ secrets.CODECOV_TOKEN }} files: ./lcov.info flags: rust fail_ci_if_error: true verbose: true