ci: make the backend job work on the local Forgejo runner

minio/minio is gone from Docker Hub (use the bitnami image that starts without a command), install psql/protoc/socat in the bare job container (no sudo), forward the services to localhost, and fetch non-mirrored actions from github.com.
This commit is contained in:
loki5512344 2026-10-09 22:15:55 +02:00
parent b0ee4ab317
commit fa08d50704
Signed by: boba
GPG key ID: 253067914055423B

View file

@ -28,34 +28,38 @@ jobs:
--health-interval 5s --health-interval 5s
--health-timeout 5s --health-timeout 5s
--health-retries 10 --health-retries 10
# minio/minio left Docker Hub and needs a `server /data` command that
# service containers cannot pass; the bitnami image starts on its own.
s3: s3:
image: minio/minio:latest image: bitnamilegacy/minio:latest
env: env:
MINIO_ROOT_USER: minioadmin MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin MINIO_ROOT_PASSWORD: minioadmin
ports:
- 9000:9000
options: >-
--health-cmd "mc ready local || curl -sf http://localhost:9000/minio/health/live"
--health-interval 5s
--health-timeout 5s
--health-retries 20
env: env:
DATABASE_URL: postgres://lovisual:lovisual@localhost:5432/accounts_db DATABASE_URL: postgres://lovisual:lovisual@localhost:5432/accounts_db
CONFIGS_DATABASE_URL: postgres://lovisual:lovisual@localhost:5432/configs_db CONFIGS_DATABASE_URL: postgres://lovisual:lovisual@localhost:5432/configs_db
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install protoc (prost-build requirement) # Jobs run in a bare container as root: no sudo, no psql. The services
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler # are reachable by name, so socat forwards them to the localhost URLs the
# tests and env use.
- name: Install protoc, psql and socat
run: apt-get update && apt-get install -y protobuf-compiler postgresql-client socat
- name: Expose services on localhost
run: |
socat TCP-LISTEN:5432,fork,reuseaddr TCP:postgres:5432 &
socat TCP-LISTEN:9000,fork,reuseaddr TCP:s3:9000 &
sleep 1
- name: Install Rust toolchain - name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable uses: https://github.com/dtolnay/rust-toolchain@stable
with: with:
components: clippy, rustfmt components: clippy, rustfmt
- name: Cache cargo build - name: Cache cargo build
uses: Swatinem/rust-cache@v2 uses: https://github.com/Swatinem/rust-cache@v2
with: with:
workspaces: backend workspaces: backend
@ -86,7 +90,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install bun - name: Install bun
uses: oven-sh/setup-bun@v2 uses: https://github.com/oven-sh/setup-bun@v2
- name: Cache bun install - name: Cache bun install
uses: actions/cache@v4 uses: actions/cache@v4