Skip to content

Commit

Permalink
feat: git-like -C argument, integration tests (#103)
Browse files Browse the repository at this point in the history
Added an argument almost equivalent to Git's "-C", mainly for the
purpose of making integration tests isolated. This feature depends on
cocogitto/cocogitto#428, and therefore v6.2.0, as the commit will
otherwise still be made in the current working directory.
This commit reduces code test coverage as many skips were removed.
  • Loading branch information
cococonscious authored Dec 9, 2024
1 parent c6bc908 commit 07f0226
Show file tree
Hide file tree
Showing 9 changed files with 655 additions and 151 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/call-build-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ env:
RUST_BACKTRACE: 1
RUSTFLAGS: -D warnings
RUSTUP_MAX_RETRIES: 10
ACT: false

defaults:
run:
Expand Down Expand Up @@ -71,17 +72,16 @@ jobs:
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/setup-cross-toolchain-action@v1
if: startsWith(matrix.os, 'ubuntu')
with:
target: ${{ matrix.target }}
if: startsWith(matrix.os, 'ubuntu') && !contains(matrix.target, '-musl')
- uses: taiki-e/install-action@cross
if: contains(matrix.target, '-musl')
- uses: taiki-e/upload-rust-binary-action@v1
with:
dry-run: ${{ env.ACT }}
bin: ${{ inputs.package_name }}
ref: ${{ inputs.tag_ref }}
target: ${{ matrix.target }}
tar: all
zip: windows
features: ${{ contains(matrix.target, 'windows') && 'vendored-openssl' || '' }}
features: 'vendored-openssl'
token: ${{ secrets.GITHUB_TOKEN }}
15 changes: 11 additions & 4 deletions .github/workflows/push-pr-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ on:
- main
pull_request:

env:
ACT: false

jobs:
test:
name: cargo test
Expand All @@ -25,6 +28,7 @@ jobs:
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@stable
- run: git config --global user.name "tests" && git config --global user.email "[email protected]"
- run: cargo test --all-features

coverage:
Expand All @@ -40,11 +44,15 @@ jobs:
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- run: cargo install cargo-tarpaulin
- run: cargo tarpaulin --out Xml
- uses: dtolnay/rust-toolchain@stable
- uses: taiki-e/install-action@cargo-tarpaulin
- run: git config --global user.name "tests" && git config --global user.email "[email protected]"
- run: cargo tarpaulin --out Xml --engine llvm
- uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
dry_run: ${{ env.ACT }}

lints:
name: cargo clippy & fmt
Expand All @@ -60,7 +68,6 @@ jobs:
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- run: rustup component add rustfmt clippy
- run: cargo clippy --all-targets --all-features -- -D warnings
- run: cargo fmt --all -- --check
Loading

0 comments on commit 07f0226

Please sign in to comment.