mirror of
https://codeberg.org/likwid/likwid.git
synced 2026-02-09 21:13:09 +00:00
ci: harden woodpecker backend step
This commit is contained in:
parent
16f3310ac8
commit
a889bc3ff3
1 changed files with 18 additions and 3 deletions
|
|
@ -1,14 +1,29 @@
|
||||||
steps:
|
steps:
|
||||||
backend:
|
backend:
|
||||||
image: rust:1.76-bookworm
|
image: rust:1.93-bookworm
|
||||||
environment:
|
environment:
|
||||||
DATABASE_URL: postgres://postgres:postgres@postgres:5432/likwid_ci
|
DATABASE_URL: postgres://postgres:postgres@postgres:5432/likwid_ci
|
||||||
RUST_BACKTRACE: 1
|
RUST_BACKTRACE: 1
|
||||||
commands:
|
commands:
|
||||||
- rustup component add rustfmt clippy
|
- 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
|
- 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 fmt --all -- --check
|
||||||
- cargo clippy -j 2 --all-targets --all-features -- -D warnings
|
- cargo clippy -j 2 --all-targets --all-features -- -D warnings
|
||||||
- cargo test -j 2 --all
|
- cargo test -j 2 --all
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue