From f1411fa52bb4c26e261cfca41b43c7891efcb4ba Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Tue, 23 Aug 2022 16:26:58 +0200 Subject: [PATCH 01/20] TRY FIX: coverage Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 464f161..44cbc19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,7 +59,10 @@ jobs: RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - id: coverage - uses: actions-rs/grcov@v0.1 + run: | + - LLVM_PROFILE_FILE="your_name-%p-%m.profraw" cargo test --verbose + - ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info + - bash <(curl -s https://codecov.io/bash) -f lcov.info - uses: codecov/codecov-action@v3 with: fail_ci_if_error: true From dfef3d8683ebcd4d3ab8dd8a210c82fe34a48c0a Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 16:27:43 +0200 Subject: [PATCH 02/20] FIX: run calls Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 44cbc19..094169f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,9 +60,9 @@ jobs: RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - id: coverage run: | - - LLVM_PROFILE_FILE="your_name-%p-%m.profraw" cargo test --verbose - - ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info - - bash <(curl -s https://codecov.io/bash) -f lcov.info + LLVM_PROFILE_FILE="your_name-%p-%m.profraw" cargo test --verbose + ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info + bash <(curl -s https://codecov.io/bash) -f lcov.info - uses: codecov/codecov-action@v3 with: fail_ci_if_error: true From edc5fd757ffe7b382bda3b013eb2adb34d219143 Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 17:50:07 +0200 Subject: [PATCH 03/20] TRY FIX: get grcov Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 094169f..7778b3f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,6 +60,7 @@ jobs: RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - id: coverage run: | + curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - LLVM_PROFILE_FILE="your_name-%p-%m.profraw" cargo test --verbose ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info bash <(curl -s https://codecov.io/bash) -f lcov.info From d49b472003439aad6bc7db76a8d1ca65332d109a Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 18:33:36 +0200 Subject: [PATCH 04/20] TRY FIX: coverage path Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7778b3f..4b2839d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,16 +59,16 @@ jobs: RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - id: coverage + name: create coverage run: | curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - LLVM_PROFILE_FILE="your_name-%p-%m.profraw" cargo test --verbose ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info - bash <(curl -s https://codecov.io/bash) -f lcov.info - uses: codecov/codecov-action@v3 with: fail_ci_if_error: true verbose: true - file: ${{ steps.coverage.outputs.report }} + file: ${{ steps.coverage.outputs.lcov.info }} all-doc-tests: runs-on: ubuntu-latest steps: From a9e010ac27fa8a55df73127428a7a9e27313beb6 Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 18:33:48 +0200 Subject: [PATCH 05/20] UPDATE: ignore grcov Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 14764b1..c0a0a56 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /dist **/*.rs.bk +/grcov From 4a9f59159d4da421cdc5747dc775a57f86373e33 Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 21:18:01 +0200 Subject: [PATCH 06/20] REMOVE: standalone test Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b2839d..691bce7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -50,14 +50,6 @@ jobs: toolchain: nightly override: true - uses: Swatinem/rust-cache@v1 - - uses: actions-rs/cargo@v1 - with: - command: test - args: --profile coverage --all-targets --all-features --no-fail-fast - env: - CARGO_INCREMENTAL: '0' - RUSTFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - RUSTDOCFLAGS: '-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' - id: coverage name: create coverage run: | From 0cf72b392dcbc85326575c8461c7cd65efff83da Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 21:20:15 +0200 Subject: [PATCH 07/20] FIX: env vars Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 691bce7..b91a313 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,7 +54,9 @@ jobs: name: create coverage run: | curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - - LLVM_PROFILE_FILE="your_name-%p-%m.profraw" cargo test --verbose + export RUSTFLAGS="-Cinstrument-coverage" + export LLVM_PROFILE_FILE="whist_browser-%p-%m.profraw" + cargo test --verbose ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info - uses: codecov/codecov-action@v3 with: From b8aa0bc74531d3b426c93a8e64abc1d201823f11 Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 21:20:33 +0200 Subject: [PATCH 08/20] UPDATE: test only src Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b91a313..7ef60c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -56,7 +56,7 @@ jobs: curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - export RUSTFLAGS="-Cinstrument-coverage" export LLVM_PROFILE_FILE="whist_browser-%p-%m.profraw" - cargo test --verbose + cargo test src --verbose ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info - uses: codecov/codecov-action@v3 with: From 1359eb3579a266c5d963a010ac28c30e2e5c7b35 Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 21:29:18 +0200 Subject: [PATCH 09/20] ADD: merge of coverage data Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7ef60c2..ca45c21 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,6 +57,7 @@ jobs: export RUSTFLAGS="-Cinstrument-coverage" export LLVM_PROFILE_FILE="whist_browser-%p-%m.profraw" cargo test src --verbose + llvm-profdata merge -sparse whist_browser-*.profraw -o whist_browser.profdata ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info - uses: codecov/codecov-action@v3 with: From 89cdd19ad38394289d78af47e8cc56cc9fcc7844 Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 21:31:53 +0200 Subject: [PATCH 10/20] UPDATE: ignore any coverage data Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c0a0a56..2ae1e0b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ **/*.rs.bk /grcov +*.profraw From 5ce35243d4c664f6869de0554a09e7990aaa5b43 Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 21:44:27 +0200 Subject: [PATCH 11/20] UPDATE: ignore profdata Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 2ae1e0b..7b4641c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ **/*.rs.bk /grcov *.profraw +*.profdata From 8b5511830e7f5bbc3d197556da23bfc52d9d8ff5 Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 21:52:37 +0200 Subject: [PATCH 12/20] REMOVE: merge Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ca45c21..7ef60c2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -57,7 +57,6 @@ jobs: export RUSTFLAGS="-Cinstrument-coverage" export LLVM_PROFILE_FILE="whist_browser-%p-%m.profraw" cargo test src --verbose - llvm-profdata merge -sparse whist_browser-*.profraw -o whist_browser.profdata ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info - uses: codecov/codecov-action@v3 with: From 5e259a348130ff47be11dd963fe0b52321f562af Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 21:57:22 +0200 Subject: [PATCH 13/20] UPDATE: use cargo action Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7ef60c2..74b785c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,6 +41,10 @@ jobs: test-coverage: runs-on: ubuntu-latest steps: + - name: Setup environment + run: | + export RUSTFLAGS="-Cinstrument-coverage" + export LLVM_PROFILE_FILE="whist_browser-%p-%m.profraw" - uses: actions/checkout@v3 - name: Install libs run: sudo apt-get update; sudo apt-get install --no-install-recommends g++ pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev libssl-dev @@ -50,13 +54,15 @@ jobs: toolchain: nightly override: true - uses: Swatinem/rust-cache@v1 + - name: Run coverage tests on src + uses: actions-rs/cargo@v1 + with: + command: test + args: src - id: coverage name: create coverage run: | curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - - export RUSTFLAGS="-Cinstrument-coverage" - export LLVM_PROFILE_FILE="whist_browser-%p-%m.profraw" - cargo test src --verbose ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info - uses: codecov/codecov-action@v3 with: From d8cc16ca7377def8ce4097612c469da633e4422c Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 21:58:13 +0200 Subject: [PATCH 14/20] BUMP: cache Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 74b785c..0e7c0b0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,7 +53,7 @@ jobs: profile: minimal toolchain: nightly override: true - - uses: Swatinem/rust-cache@v1 + - uses: Swatinem/rust-cache@v2 - name: Run coverage tests on src uses: actions-rs/cargo@v1 with: From 9d5f3e2ef93550e4343d017d4792e2d1f8641cd7 Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 22:04:07 +0200 Subject: [PATCH 15/20] UPDATE: use action to install grcov Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0e7c0b0..6c0ad3f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,6 +53,10 @@ jobs: profile: minimal toolchain: nightly override: true + - uses: actions-rs/cargo@v1 + with: + command: install + args: grcov - uses: Swatinem/rust-cache@v2 - name: Run coverage tests on src uses: actions-rs/cargo@v1 @@ -62,8 +66,7 @@ jobs: - id: coverage name: create coverage run: | - curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf - - ./grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info + grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info - uses: codecov/codecov-action@v3 with: fail_ci_if_error: true From 548516551ffde37ec5e2b53458fd4b23b2ea88d8 Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 22:05:25 +0200 Subject: [PATCH 16/20] UPDATE: use name of install step Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6c0ad3f..d7fe49a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -54,6 +54,7 @@ jobs: toolchain: nightly override: true - uses: actions-rs/cargo@v1 + name: Install grcov with: command: install args: grcov From e5819449fb4880efcc60417c8ac7257f96e5f06f Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 22:06:57 +0200 Subject: [PATCH 17/20] ADD: llvm tools Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d7fe49a..4b027da 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,6 +53,7 @@ jobs: profile: minimal toolchain: nightly override: true + components: llvm-tools-preview - uses: actions-rs/cargo@v1 name: Install grcov with: From 682e28be263afb743aa59494f43db927f90bc60a Mon Sep 17 00:00:00 2001 From: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 22:25:11 +0200 Subject: [PATCH 18/20] FIX: run test and coverage in on step Signed-off-by: Segelzwerg <25705862+Segelzwerg@users.noreply.github.com> --- .github/workflows/main.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4b027da..4c3906c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,14 +60,10 @@ jobs: command: install args: grcov - uses: Swatinem/rust-cache@v2 - - name: Run coverage tests on src - uses: actions-rs/cargo@v1 - with: - command: test - args: src - id: coverage name: create coverage run: | + cargo test src grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore "/*" -o lcov.info - uses: codecov/codecov-action@v3 with: From 22a7d93ef3fd8a2b891b5c6a1e174c66cc8f0930 Mon Sep 17 00:00:00 2001 From: Marcel <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 22:54:39 +0200 Subject: [PATCH 19/20] FIX: env setup --- .github/workflows/main.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4c3906c..c1f759a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,10 +41,9 @@ jobs: test-coverage: runs-on: ubuntu-latest steps: - - name: Setup environment - run: | - export RUSTFLAGS="-Cinstrument-coverage" - export LLVM_PROFILE_FILE="whist_browser-%p-%m.profraw" + - env: + RUSTFLAGS: "-Cinstrument-coverage" + LLVM_PROFILE_FILE: "whist_browser-%p-%m.profraw" - uses: actions/checkout@v3 - name: Install libs run: sudo apt-get update; sudo apt-get install --no-install-recommends g++ pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev libssl-dev From be8111b83fd621ff4eb1ca9bee5b693e7e8a6771 Mon Sep 17 00:00:00 2001 From: Marcel <25705862+Segelzwerg@users.noreply.github.com> Date: Wed, 24 Aug 2022 22:56:38 +0200 Subject: [PATCH 20/20] FIX: env position --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c1f759a..2e323bf 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -40,10 +40,10 @@ jobs: args: --all-targets --all-features -- --nocapture test-coverage: runs-on: ubuntu-latest + env: + RUSTFLAGS: "-Cinstrument-coverage" + LLVM_PROFILE_FILE: "whist_browser-%p-%m.profraw" steps: - - env: - RUSTFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "whist_browser-%p-%m.profraw" - uses: actions/checkout@v3 - name: Install libs run: sudo apt-get update; sudo apt-get install --no-install-recommends g++ pkg-config libx11-dev libasound2-dev libudev-dev libwayland-dev libxkbcommon-dev libssl-dev