From c1f3b840822cde15628a907de425f570a10dc560 Mon Sep 17 00:00:00 2001 From: x-hgg-x <39058530+x-hgg-x@users.noreply.github.com> Date: Mon, 22 Aug 2022 08:21:50 +0200 Subject: [PATCH 1/5] Run also integration tests for coverage --- github-org-artichoke/templates/rust-code-coverage.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/github-org-artichoke/templates/rust-code-coverage.yaml b/github-org-artichoke/templates/rust-code-coverage.yaml index 89deeb43..5d7b67a0 100644 --- a/github-org-artichoke/templates/rust-code-coverage.yaml +++ b/github-org-artichoke/templates/rust-code-coverage.yaml @@ -44,9 +44,7 @@ jobs: RUSTFLAGS: "-C instrument-coverage" # Unstable feature: https://github.com/rust-lang/rust/issues/56925 RUSTDOCFLAGS: "-C instrument-coverage -Z unstable-options --persist-doctests target/debug/doctests" - run: | - cargo +nightly test --lib - cargo +nightly test --doc + run: cargo test - name: Generate HTML report run: grcov ${github_repository}*.profraw --source-dir . --binary-path target/debug -t html --filter covered -o target/coverage From ee9bacd6c1dbaa31092c665846df4cb78e08c8bd Mon Sep 17 00:00:00 2001 From: x-hgg-x <39058530+x-hgg-x@users.noreply.github.com> Date: Mon, 22 Aug 2022 08:24:18 +0200 Subject: [PATCH 2/5] Keep only src folder for coverage --- github-org-artichoke/templates/rust-code-coverage.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github-org-artichoke/templates/rust-code-coverage.yaml b/github-org-artichoke/templates/rust-code-coverage.yaml index 5d7b67a0..dca3fdb5 100644 --- a/github-org-artichoke/templates/rust-code-coverage.yaml +++ b/github-org-artichoke/templates/rust-code-coverage.yaml @@ -47,10 +47,10 @@ jobs: run: cargo test - name: Generate HTML report - run: grcov ${github_repository}*.profraw --source-dir . --binary-path target/debug -t html --filter covered -o target/coverage + run: grcov ${github_repository}*.profraw --source-dir . --keep-only 'src/*' --binary-path target/debug -t html --filter covered -o target/coverage - name: Generate detailed JSON report - run: grcov ${github_repository}*.profraw --source-dir . --binary-path target/debug -t covdir --filter covered -o target/coverage/coverage.json + run: grcov ${github_repository}*.profraw --source-dir . --keep-only 'src/*' --binary-path target/debug -t covdir --filter covered -o target/coverage/coverage.json - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@master From e1c86a79a96918fd90c8e9d660f704f2fb3edbce Mon Sep 17 00:00:00 2001 From: Ryan Lopopolo Date: Mon, 22 Aug 2022 08:03:53 -0700 Subject: [PATCH 3/5] Use recursive glob on `src/**/*.rs` --- github-org-artichoke/templates/rust-code-coverage.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/github-org-artichoke/templates/rust-code-coverage.yaml b/github-org-artichoke/templates/rust-code-coverage.yaml index dca3fdb5..ce0dc318 100644 --- a/github-org-artichoke/templates/rust-code-coverage.yaml +++ b/github-org-artichoke/templates/rust-code-coverage.yaml @@ -47,10 +47,10 @@ jobs: run: cargo test - name: Generate HTML report - run: grcov ${github_repository}*.profraw --source-dir . --keep-only 'src/*' --binary-path target/debug -t html --filter covered -o target/coverage + run: grcov ${github_repository}*.profraw --source-dir . --keep-only 'src/**/*.rs' --binary-path target/debug -t html --filter covered -o target/coverage - name: Generate detailed JSON report - run: grcov ${github_repository}*.profraw --source-dir . --keep-only 'src/*' --binary-path target/debug -t covdir --filter covered -o target/coverage/coverage.json + run: grcov ${github_repository}*.profraw --source-dir . --keep-only 'src/**/*.rs' --binary-path target/debug -t covdir --filter covered -o target/coverage/coverage.json - name: Configure AWS Credentials uses: aws-actions/configure-aws-credentials@master From acb03357bce89bb46336b44ca222696c1b122a08 Mon Sep 17 00:00:00 2001 From: Ryan Lopopolo Date: Mon, 22 Aug 2022 08:04:29 -0700 Subject: [PATCH 4/5] Prepare to deploy code coverage workflow --- ...epository_file_github_actions_rust_code_coverage_workflow.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github-org-artichoke/repository_file_github_actions_rust_code_coverage_workflow.tf b/github-org-artichoke/repository_file_github_actions_rust_code_coverage_workflow.tf index 478f6bf5..f5d4a913 100644 --- a/github-org-artichoke/repository_file_github_actions_rust_code_coverage_workflow.tf +++ b/github-org-artichoke/repository_file_github_actions_rust_code_coverage_workflow.tf @@ -2,7 +2,7 @@ locals { // Set `force_bump_s3_backup` to true to create branches for PRs that update // the S3 backup workflow organization-wide. - force_bump_rust_code_coverage = false + force_bump_rust_code_coverage = true rust_code_coverage_repos = [ "boba", // https://github.com/artichoke/boba "focaccia", // https://github.com/artichoke/focaccia From c017b209e4e92d7086bb5d54caa6f9caf0bb6b87 Mon Sep 17 00:00:00 2001 From: Ryan Lopopolo Date: Mon, 22 Aug 2022 08:19:21 -0700 Subject: [PATCH 5/5] Deployment complete --- ...epository_file_github_actions_rust_code_coverage_workflow.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github-org-artichoke/repository_file_github_actions_rust_code_coverage_workflow.tf b/github-org-artichoke/repository_file_github_actions_rust_code_coverage_workflow.tf index f5d4a913..478f6bf5 100644 --- a/github-org-artichoke/repository_file_github_actions_rust_code_coverage_workflow.tf +++ b/github-org-artichoke/repository_file_github_actions_rust_code_coverage_workflow.tf @@ -2,7 +2,7 @@ locals { // Set `force_bump_s3_backup` to true to create branches for PRs that update // the S3 backup workflow organization-wide. - force_bump_rust_code_coverage = true + force_bump_rust_code_coverage = false rust_code_coverage_repos = [ "boba", // https://github.com/artichoke/boba "focaccia", // https://github.com/artichoke/focaccia