From 8cbd4d3f0783e4791021db36f6776fa1c628220b Mon Sep 17 00:00:00 2001 From: pepedinho <2spii94@gmail.com> Date: Sun, 12 Oct 2025 17:51:44 +0200 Subject: [PATCH 1/3] ci: add tarpaulin tests coverage and codecov integration --- .github/workflows/ci.yml | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb2d74c..d32baba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,4 +74,42 @@ jobs: uses: actions/upload-artifact@v4 with: name: rust-binary - path: target/release/ \ No newline at end of file + path: target/release/ + + coverage: + name: Code Coverage + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + run: | + rustup update stable + rustup default stable + + - name: Install Tarpaulin + run: cargo install cargo-tarpaulin + + - name: Run coverage + run: | + mkdir -p coverage + cargo tarpaulin \ + --engine llvm \ + --timeout 300 \ + --out Lcov \ + --out Html \ + --output-dir coverage \ + -- --test-threads=1 + + - name: Upload coverage report + uses: actions/upload-artifact@v4 + with: + name: coverage-report + path: coverage + - name: Upload to Codecov + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: coverage/tarpaulin-report.lcov + flags: unittests + fail_ci_if_error: true \ No newline at end of file From 10b2f8485a421e55a8dcb3bea88235b625e74817 Mon Sep 17 00:00:00 2001 From: pepedinho <2spii94@gmail.com> Date: Sun, 12 Oct 2025 17:57:00 +0200 Subject: [PATCH 2/3] ci: fix ci cfg --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d32baba..77b83e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,6 +90,11 @@ jobs: - name: Install Tarpaulin run: cargo install cargo-tarpaulin + - name: Clear files + run: rm -rf ~/.local/share/fleetd + - name: Prepare directory + run: mkdir -p ~/.fleet/logs ~/.fleet/metrics + - name: Run coverage run: | mkdir -p coverage From 0fd2bccfe72b69121efff2fb6ef70ab830187d32 Mon Sep 17 00:00:00 2001 From: pepedinho <2spii94@gmail.com> Date: Sun, 12 Oct 2025 18:07:13 +0200 Subject: [PATCH 3/3] ci: set env variables in test ci job for more details on failure --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 77b83e3..d3d4904 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,9 @@ jobs: - name: Prepare directory run: mkdir -p ~/.fleet/logs ~/.fleet/metrics - name: Run cargo test + env: + RUST_BACKTRACE: full + RUST_LOG: debug run: cargo test --features no-tty --test utiles_test --test scheduler_test --test git_test --test daemon_test -- --test-threads=1 build: