Move some build commands to CI (#1101)

This commit is contained in:
Yuri Astrakhan 2023-12-24 23:43:58 -05:00 committed by GitHub
parent 3939619e11
commit c8df2799db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 17 deletions

View File

@ -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

View File

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

View File

@ -275,10 +275,13 @@ 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:
@ -286,8 +289,7 @@ clippy-md:
'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]
@ -296,6 +298,7 @@ env-info:
{{ just_executable() }} --version
rustc --version
cargo --version
rustup --version
# Update sqlite database schema.
prepare-sqlite: install-sqlx