Skip to content

Commit

Permalink
Move some build commands to CI (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyurik authored Dec 25, 2023
1 parent 3939619 commit c8df279
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .cargo-husky/hooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
echo "----------------------------------------------------------------------------------------"
echo "These tests run automatically before the git push"
echo "If you want to push your changes without testing them first, use git push --no-verify"
echo "To simplify this, create an alias, e.g. like so:"
echo " git config --global alias.pushn 'push --no-verify'"
echo "Then you can use git pushn to push without testing"
echo "----------------------------------------------------------------------------------------"

set -e
Expand Down
22 changes: 8 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,18 @@ jobs:
postgis/postgis:16-3.4
-c "exec docker-entrypoint.sh postgres -c ssl=on -c ssl_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem -c ssl_key_file=/etc/ssl/private/ssl-cert-snakeoil.key"
steps:
- uses: taiki-e/install-action@v2
with:
tool: just
- name: Checkout sources
uses: actions/checkout@v4
- name: Rust Versions
run: rustc --version && cargo --version
- uses: Swatinem/rust-cache@v2
if: github.event_name != 'release' && github.event_name != 'workflow_dispatch'
- run: cargo fmt --all -- --check
- run: cargo clippy --package martin-tile-utils --tests --lib --bins --benches -- -D warnings
- run: cargo clippy --package mbtiles --tests --lib --bins --benches --no-default-features -- -D warnings
- run: cargo clippy --package mbtiles --tests --lib --bins --benches -- -D warnings
- run: cargo clippy --package martin --tests --lib --bins --benches -- -D warnings
- run: RUSTFLAGS='-D warnings' cargo check --package martin --tests --lib --bins --benches --no-default-features
- run: RUSTFLAGS='-D warnings' cargo check --package martin --tests --lib --bins --benches --no-default-features --features fonts
- run: RUSTFLAGS='-D warnings' cargo check --package martin --tests --lib --bins --benches --no-default-features --features sprites
- run: cargo clippy --package martin --features bless-tests -- -D warnings
- run: cargo doc --no-deps --workspace
env:
RUSTDOCFLAGS: '-D warnings'
- run: just env-info
- run: just fmt
- run: just clippy
- run: just check
- run: just check-doc
- name: Init database
run: tests/fixtures/initdb.sh
env:
Expand Down
9 changes: 6 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -275,19 +275,21 @@ fmt2:
check:
cargo check --workspace --all-targets --bins --tests --lib --benches

# Verify doc build
check-doc:
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --workspace

# Run cargo clippy
clippy:
cargo clippy --workspace --all-targets --bins --tests --lib --benches -- -D warnings
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --workspace

# Validate markdown URLs with markdown-link-check
clippy-md:
docker run -it --rm -v ${PWD}:/workdir --entrypoint sh ghcr.io/tcort/markdown-link-check -c \
'echo -e "/workdir/README.md\n$(find /workdir/docs/src -name "*.md")" | tr "\n" "\0" | xargs -0 -P 5 -n1 -I{} markdown-link-check --config /workdir/.github/files/markdown.links.config.json {}'

# These steps automatically run before git push via a git hook
[private]
git-pre-push: env-info restart lint test
git-pre-push: env-info restart fmt clippy check check-doc test

# Get environment info
[private]
Expand All @@ -296,6 +298,7 @@ env-info:
{{ just_executable() }} --version
rustc --version
cargo --version
rustup --version

# Update sqlite database schema.
prepare-sqlite: install-sqlx
Expand Down

0 comments on commit c8df279

Please sign in to comment.