From f1769b6e7928d1abb2c516dbccc8afadfe3fd1c1 Mon Sep 17 00:00:00 2001 From: Alex Wellnitz Date: Thu, 26 Oct 2023 09:35:25 +0200 Subject: [PATCH] feat: Update Pipelines --- .github/workflows/coverage.yml | 73 ++++++++++++++++++++++++++++++++++ .github/workflows/rust.yml | 7 +--- 2 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..205440c --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,73 @@ +name: Coverage + +on: + push: + branches: + - develop + pull_request_target: + branches: + - develop + +env: + CARGO_TERM_COLOR: always + +jobs: + report: + name: Report + environment: coverage + runs-on: ubuntu-latest + env: + CARGO_INCREMENTAL: "0" + RUSTFLAGS: "-Z profile -C codegen-units=1 -C inline-threshold=0 -C link-dead-code -C overflow-checks=off -C panic=abort -Z panic_abort_tests" + RUSTDOCFLAGS: "-Z profile -C codegen-units=1 -C inline-threshold=0 -C link-dead-code -C overflow-checks=off -C panic=abort -Z panic_abort_tests" + + steps: + - id: checkout_push + if: github.event_name == 'push' + name: Checkout Repository (Push) + uses: actions/checkout@v4 + + - id: checkout_pull_request_target + if: github.event_name == 'pull_request_target' + name: Checkout Repository (Pull Request Target) + uses: actions/checkout@v4 + with: + ref: "refs/pull/${{ github.event.pull_request.number }}/head" + + - id: setup + name: Setup Toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: nightly + components: llvm-tools-preview + + - id: cache + name: Enable Workflow Cache + uses: Swatinem/rust-cache@v2 + + - id: tools + name: Install Tools + uses: taiki-e/install-action@v2 + with: + tool: grcov + + - id: check + name: Run Build Checks + run: cargo check --tests --benches --examples --workspace --all-targets --all-features + + - id: test + name: Run Unit Tests + run: cargo test --tests --benches --examples --workspace --all-targets --all-features + + - id: coverage + name: Generate Coverage Report + uses: alekitto/grcov@v0.2 + + - id: upload + name: Upload Coverage Report + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ steps.coverage.outputs.report }} + verbose: true + fail_ci_if_error: true \ No newline at end of file diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6e13100..051479f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,9 +19,4 @@ jobs: - name: Build run: cargo build --verbose - name: Run tests - run: cargo test - - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} \ No newline at end of file + run: cargo test \ No newline at end of file