From 6e60712608aa4a73e4dc0d6ce37e297842fb1a62 Mon Sep 17 00:00:00 2001 From: Luke Seelenbinder Date: Tue, 17 Sep 2024 19:15:37 +0300 Subject: [PATCH] Update CI to use Justfile. --- .github/workflows/test.yml | 22 ++++------------------ justfile | 22 ++++++++++++++++------ 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1981e43..ae4d77a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,6 +16,7 @@ jobs: steps: - name: Checkout sources uses: actions/checkout@v4 + - uses: extractions/setup-just@v2 - uses: Swatinem/rust-cache@v2 if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' @@ -23,17 +24,7 @@ jobs: rustc --version cargo --version rustup --version - - run: cargo check - - run: rustup component add clippy rustfmt - - run: cargo fmt --all -- --check - - run: cargo clippy --all-targets --all-features -- -D warnings - - run: cargo test --all-targets --all-features - - run: cargo test --features http-async - - run: cargo test --features mmap-async-tokio - - run: cargo test --features tilejson - - run: cargo test --features s3-async-native - - run: cargo test --features s3-async-rustls - - run: cargo test + - run: just test-all - name: Check semver uses: obi1kenobi/cargo-semver-checks-action@v2 @@ -42,6 +33,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: extractions/setup-just@v2 - uses: Swatinem/rust-cache@v2 if: github.event_name != 'release' && github.event_name != 'workflow_dispatch' - name: Read crate metadata @@ -51,10 +43,4 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ steps.metadata.outputs.rust-version }} - - run: cargo test --all-targets --all-features - - run: cargo test --features http-async - - run: cargo test --features mmap-async-tokio - - run: cargo test --features tilejson - - run: cargo test --features s3-async-native - - run: cargo test --features s3-async-rustls - - run: cargo test + - run: just test diff --git a/justfile b/justfile index aace664..a7d9614 100644 --- a/justfile +++ b/justfile @@ -3,31 +3,41 @@ @_default: just --list --unsorted +check: + cargo check + +_add_tools: + rustup component add clippy rustfmt + # Run all tests test: # These are the same tests that are run on CI. Eventually CI should just call into justfile - cargo check - rustup component add clippy rustfmt - cargo fmt --all -- --check - cargo clippy --all-targets --all-features -- -D warnings cargo test --all-targets --all-features cargo test --features http-async cargo test --features mmap-async-tokio cargo test --features tilejson cargo test --features s3-async-native cargo test --features s3-async-rustls + cargo test --features aws-s3-async cargo test RUSTDOCFLAGS="-D warnings" cargo doc --no-deps +# Run all tests and checks +test-all: check fmt clippy + # Run cargo fmt and cargo clippy lint: fmt clippy # Run cargo fmt -fmt: +fmt: _add_tools + cargo fmt --all -- --check + +# Run cargo fmt using Rust nightly +fmt-nightly: cargo +nightly fmt -- --config imports_granularity=Module,group_imports=StdExternalCrate # Run cargo clippy -clippy: +clippy: _add_tools cargo clippy --workspace --all-targets --all-features --bins --tests --lib --benches -- -D warnings # Build and open code documentation