From 5c1ebdcf2134672ba5c637f49fd6941d5dee5d8e Mon Sep 17 00:00:00 2001 From: RJ Rybarczyk Date: Mon, 29 Nov 2021 20:35:20 +0000 Subject: [PATCH 1/5] Cargo tarpaulin GH Actions code coverage --- .github/workflows/coverage.yaml | 29 +++++++++++++++++++ .../mining-proxy/src/lib/upstream_mining.rs | 8 +++++ 2 files changed, 37 insertions(+) create mode 100644 .github/workflows/coverage.yaml diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml new file mode 100644 index 0000000000..50b988f7df --- /dev/null +++ b/.github/workflows/coverage.yaml @@ -0,0 +1,29 @@ +on: + push: + branches: + - main + pull_request: + branches: + - main + +name: Code Coverage + +jobs: + test: + name: Coverage + runs-on: ubuntu-latest + container: + image: xd009642/tarpaulin:develop-nightly + options: --security-opt seccomp=unconfined + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Generate code coverage + run: | + cargo +nightly tarpaulin --timeout 120 + + - name: Upload to codecov.io + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: true diff --git a/roles/v2/mining-proxy/src/lib/upstream_mining.rs b/roles/v2/mining-proxy/src/lib/upstream_mining.rs index a3aff0f5bd..9668afcd3d 100644 --- a/roles/v2/mining-proxy/src/lib/upstream_mining.rs +++ b/roles/v2/mining-proxy/src/lib/upstream_mining.rs @@ -318,3 +318,11 @@ impl UpstreamMiningNodes { Err(()) } } + +#[cfg(test)] +mod tests { + #[test] + fn test_one() { + assert_eq!(1, 1); + } +} From 16611807edc5209768d29f4483744ba52b821695 Mon Sep 17 00:00:00 2001 From: RJ Rybarczyk Date: Mon, 29 Nov 2021 21:01:25 +0000 Subject: [PATCH 2/5] Update sv2 header check GH Action name --- .github/workflows/sv2-header-check.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sv2-header-check.yaml b/.github/workflows/sv2-header-check.yaml index 9b11ad7375..605b3c81ef 100644 --- a/.github/workflows/sv2-header-check.yaml +++ b/.github/workflows/sv2-header-check.yaml @@ -4,7 +4,8 @@ on: pull_request: brances: [ main ] -name: Check sv2.h file is up to date with commit +# Check sv2.h file is up to date with commit +name: sv2.h Header Check jobs: sv2_header_check: From 65d159c97c3fba19ba3345945579cb001facf34c Mon Sep 17 00:00:00 2001 From: RJ Rybarczyk Date: Mon, 29 Nov 2021 21:02:53 +0000 Subject: [PATCH 3/5] Update test and lint GH Action name --- .github/workflows/rust.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index 188482e3bc..fd36ec3280 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -6,7 +6,7 @@ on: branches: - main -name: Stratum V2 +name: Test & Lint jobs: ci: From c0d1e71533c2abff38d4899dd22e0c4b169a0ec1 Mon Sep 17 00:00:00 2001 From: RJ Rybarczyk Date: Mon, 29 Nov 2021 21:07:22 +0000 Subject: [PATCH 4/5] Rm test test case --- roles/v2/mining-proxy/src/lib/upstream_mining.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/roles/v2/mining-proxy/src/lib/upstream_mining.rs b/roles/v2/mining-proxy/src/lib/upstream_mining.rs index 9668afcd3d..a3aff0f5bd 100644 --- a/roles/v2/mining-proxy/src/lib/upstream_mining.rs +++ b/roles/v2/mining-proxy/src/lib/upstream_mining.rs @@ -318,11 +318,3 @@ impl UpstreamMiningNodes { Err(()) } } - -#[cfg(test)] -mod tests { - #[test] - fn test_one() { - assert_eq!(1, 1); - } -} From 5ee63a7ea32ec9696d574643df54ba15033ffb23 Mon Sep 17 00:00:00 2001 From: RJ Rybarczyk Date: Mon, 29 Nov 2021 21:16:18 +0000 Subject: [PATCH 5/5] Add fail-under at 31% --- .github/workflows/coverage.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yaml b/.github/workflows/coverage.yaml index 50b988f7df..7c1e017c1c 100644 --- a/.github/workflows/coverage.yaml +++ b/.github/workflows/coverage.yaml @@ -21,7 +21,7 @@ jobs: - name: Generate code coverage run: | - cargo +nightly tarpaulin --timeout 120 + cargo +nightly tarpaulin --timeout 120 --fail-under 31 - name: Upload to codecov.io uses: codecov/codecov-action@v2