This repository was archived by the owner on Feb 22, 2026. It is now read-only.
Feat: Review read apis #70
Workflow file for this run
This file contains hidden or 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: CI/CD Anon Backend | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: | |
| - "anon/backend/**" | |
| push: | |
| branches: [main] | |
| paths: | |
| - "anon/backend/**" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| lint: | |
| name: lint | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: anon/backend | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| anon/backend/target | |
| key: ${{ runner.os }}-cargo-lint-${{ hashFiles('anon/backend/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-lint- | |
| ${{ runner.os }}-cargo- | |
| - name: Check formatting | |
| run: cargo fmt --all -- --check | |
| - name: Run Clippy | |
| run: cargo clippy --locked --all-targets -- -D warnings | |
| tests: | |
| name: test | |
| if: github.event.pull_request.draft == false | |
| runs-on: ubuntu-latest | |
| env: | |
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/starkfinder_test | |
| TEST_DATABASE_URL: postgres://postgres:postgres@localhost:5432/starkfinder_test | |
| defaults: | |
| run: | |
| working-directory: anon/backend | |
| services: | |
| postgres: | |
| image: postgres:16-alpine | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| anon/backend/target | |
| key: ${{ runner.os }}-cargo-test-${{ hashFiles('anon/backend/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-test- | |
| ${{ runner.os }}-cargo- | |
| - name: Install sqlx-cli and cargo-nextest | |
| run: | | |
| cargo install sqlx-cli --no-default-features --features native-tls,postgres | |
| cargo install cargo-nextest --locked | |
| - name: Install psql client | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y postgresql-client | |
| - name: Wait for Postgres | |
| run: | | |
| until pg_isready -h localhost -p 5432 -U postgres; do sleep 1; done | |
| - name: Prepare test database and run migrations | |
| run: | | |
| sqlx database create --database-url "$TEST_DATABASE_URL" || true | |
| sqlx migrate run --database-url "$TEST_DATABASE_URL" | |
| sqlx migrate info --database-url "$TEST_DATABASE_URL" | |
| - name: Build | |
| run: cargo build --verbose | |
| - name: Run tests | |
| run: cargo nextest run -j 1 --no-fail-fast --failure-output='final' |