Skip to content

Commit

Permalink
Update CI to use Justfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
lseelenbinder committed Sep 17, 2024
1 parent e5bd1fb commit 6e60712
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
22 changes: 4 additions & 18 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,15 @@ 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'

- run: |
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

Expand All @@ -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
Expand All @@ -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
22 changes: 16 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6e60712

Please sign in to comment.