diff --git a/.github/workflows/ci.coverage.yml.todo b/.github/workflows/ci.coverage.yml.todo deleted file mode 100644 index d72bf54..0000000 --- a/.github/workflows/ci.coverage.yml.todo +++ /dev/null @@ -1,61 +0,0 @@ - -# https://github.com/BamPeers/rust-ci-github-actions-workflow - -# TODO: -# on: -# pull_request: -# push: -# branches: -# - main - -# name: ci·coverage - -# permissions: -# contents: read -# checks: write -# pull-requests: write - -# jobs: -# test: -# name: Test -# env: -# PROJECT_NAME_UNDERSCORE: semverator -# CARGO_INCREMENTAL: 0 -# RUSTFLAGS: -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests -Cpanic=abort -D warnings -# RUSTDOCFLAGS: -Cpanic=abort -# strategy: -# matrix: -# os: [ubuntu-latest, macos-latest] -# runs-on: ${{ matrix.os }} -# steps: -# - uses: actions/checkout@v4 -# - uses: dtolnay/rust-toolchain@stable - id: toolchain -# - name: Cache dependencies -# uses: actions/cache@v4 -# env: -# cache-name: ${{ steps.toolchain.outputs.cachekey }} -# with: -# path: | -# ~/.cargo/.crates.toml -# ~/.cargo/.crates2.json -# ~/.cargo/bin -# ~/.cargo/registry/index -# ~/.cargo/registry/cache -# target -# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('Cargo.lock') }} -# coverage: -# name: Coverage -# strategy: -# matrix: -# os: [ubuntu-latest, macos-latest] -# runs-on: ${{ matrix.os }} -# steps: -# - uses: actions/checkout@v4 -# - uses: dtolnay/rust-toolchain@stable -# - run: cargo install cargo-tarpaulin -# - name: Generate test result and coverage report -# run: cargo tarpaulin --engine ptrace -o lcov --output-dir coverage -# - uses: coverallsapp/github-action@v2 -# with: -# path-to-lcov: coverage/lcov.info diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af1219d..17eb2c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,12 @@ name: ci·rs concurrency: group: ci·rs·${{ github.ref}} + cancel-in-progress: true + +permissions: + contents: read + checks: write + pull-requests: write jobs: check: @@ -71,3 +77,28 @@ jobs: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable - run: cargo run --all-features -- git --version + + coverage: + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - run: cargo install cargo-tarpaulin + - run: cargo tarpaulin -o lcov --output-dir coverage + - uses: coverallsapp/github-action@v2 + with: + path-to-lcov: coverage/lcov.info + parallel: true + flag-name: ${{ matrix.os }} + + upload-coverage: + needs: coverage + if: ${{ always() }} + runs-on: ubuntu-latest + steps: + - uses: coverallsapp/github-action@v2 + with: + parallel-finished: true