chore(build, api): bump builder image to rust:1.84-slim-bookworm #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Retrack | |
on: | |
push: | |
branches: [ main ] | |
paths-ignore: | |
- 'Dockerfile' | |
- 'Dockerfile.*' | |
- '*.md' | |
- 'retrack.toml' | |
- '.husky/**' | |
- 'dev/**' | |
env: | |
CARGO_TERM_COLOR: always | |
DATABASE_URL: postgres://postgres@localhost:5432/retrack | |
RUST_LOG: debug | |
jobs: | |
ci: | |
name: API Build (Linux) | |
runs-on: ubuntu-latest | |
timeout-minutes: 20 | |
strategy: | |
matrix: | |
rust: [ stable ] | |
services: | |
postgres: | |
image: postgres:latest | |
env: | |
POSTGRES_HOST_AUTH_METHOD: trust | |
ports: | |
- 5432:5432 | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
# Always install nightly toolchain for `Rustfmt`. | |
- name: Install toolchain ${{ matrix.rust }} | |
run: | | |
rustup toolchain install ${{ matrix.rust }} nightly | |
rustup override set ${{ matrix.rust }} | |
rustup component add clippy | |
rustup component add --toolchain nightly rustfmt | |
cargo install --force sqlx-cli | |
- name: Cache Dependencies | |
uses: Swatinem/rust-cache@v2 | |
- name: Check format | |
run: cargo +nightly fmt --all -- --check | |
- name: Create test database | |
run: | | |
cargo sqlx database create | |
cargo sqlx migrate run | |
- name: Test (default features) | |
timeout-minutes: 6 | |
run: cargo test -- --nocapture | |
- name: Check database schema | |
run: cargo sqlx prepare --check | |
- name: Build (default features) | |
run: cargo build --release | |
- name: Clippy | |
run: cargo clippy --all-targets -- -D warnings | |
ci-web-scraper: | |
name: Web Scraper Build (Linux) | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- uses: actions/checkout@v4 | |
name: Checkout | |
- name: Set Node.js 22.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22.x | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci --ws | |
- name: Test | |
run: npm test -w components/retrack-web-scraper | |
- name: Build | |
run: npm run build -w components/retrack-web-scraper | |
# ci-control-center: | |
# name: Build (Linux) | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v3 | |
# name: Checkout | |
# | |
# - name: Set Node.js 20.x | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: 20.x | |
# cache: 'npm' | |
# | |
# - name: Install dependencies | |
# run: npm ci | |
# | |
# - name: Build | |
# run: npm run build --ws |