From d849ffad892281f64656e6999e0e8922c12ff7cb Mon Sep 17 00:00:00 2001 From: Sebastien Iooss Date: Thu, 11 Jan 2024 12:12:10 +0100 Subject: [PATCH] ci: add code coverage --- .github/workflows/build_test.yml | 16 ++++++++++++---- .gitignore | 1 + Readme.md | 1 - 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_test.yml b/.github/workflows/build_test.yml index 940f8d0..6065eaa 100644 --- a/.github/workflows/build_test.yml +++ b/.github/workflows/build_test.yml @@ -4,7 +4,7 @@ on: workflow_dispatch: jobs: - fmt: + fmt-lint-build-test: runs-on: ubuntu-latest env: DATABASE_URL: sqlite://${{ github.workspace }}/examples/universe.db @@ -22,7 +22,15 @@ jobs: - name: Test dev run: cargo test - name: Build release - run: cargo build + run: cargo build --release - name: Test release - run: cargo test - + run: cargo test --release + - name: Install code coverage tool + run: cargo install cargo-tarpaulin + - name: Generate code coverage + run: cargo tarpaulin --out Html + - name: Archive code coverage results + uses: actions/upload-artifact@v1 + with: + name: code-coverage-report + path: tarpaulin-report.html diff --git a/.gitignore b/.gitignore index 92c7510..7d5d2d0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ target old .cargo +tarpaulin-report.html diff --git a/Readme.md b/Readme.md index d42365b..499fa06 100644 --- a/Readme.md +++ b/Readme.md @@ -47,7 +47,6 @@ Contains code to connect and read from the DB, process the CLI input and definin ## TODO -- coverage is missing - bulding the docker image - pushing to dockerhub with a dev tag - release-please