ci: harden woodpecker backend step

This commit is contained in:
Marco Allegretti 2026-02-03 17:48:21 +01:00
parent 16f3310ac8
commit a889bc3ff3

View file

@ -1,14 +1,29 @@
steps:
backend:
image: rust:1.76-bookworm
image: rust:1.93-bookworm
environment:
DATABASE_URL: postgres://postgres:postgres@postgres:5432/likwid_ci
RUST_BACKTRACE: 1
commands:
- rustup component add rustfmt clippy
- cargo install -j 2 sqlx-cli --no-default-features --features postgres,tls-rustls
- cargo install -j 2 sqlx-cli --version 0.8.6 --locked --no-default-features --features postgres,tls-rustls
- cd backend
- sqlx migrate run
- |
ok=0
i=1
while [ "$i" -le 30 ]; do
if sqlx migrate run; then
ok=1
break
fi
echo "sqlx migrate run failed (attempt ${i}/30); waiting for postgres..."
sleep 1
i=$((i + 1))
done
if [ "$ok" -ne 1 ]; then
echo "sqlx migrate run failed after 30 attempts"
exit 1
fi
- cargo fmt --all -- --check
- cargo clippy -j 2 --all-targets --all-features -- -D warnings
- cargo test -j 2 --all