format #25
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 | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| env: | |
| CARGO_TERM_COLOR: always | |
| SQLX_OFFLINE: "true" | |
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/beyond_queue | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:18 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: beyond_queue | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready --health-interval 5s --health-timeout 5s --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: jdx/mise-action@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: install postgres 18 dev headers | |
| run: | | |
| sudo apt-get install -y gnupg2 lsb-release | |
| wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc \ | |
| | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/pgdg.gpg | |
| echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" \ | |
| | sudo tee /etc/apt/sources.list.d/pgdg.list | |
| sudo apt-get update | |
| sudo apt-get install -y postgresql-server-dev-18 libclang-dev clang | |
| - name: build and install beyond-queue-extension | |
| env: | |
| POSTGRES_CONTAINER: ${{ job.services.postgres.id }} | |
| run: | | |
| PGRX_PG_CONFIG_PATH=/usr/lib/postgresql/18/bin/pg_config \ | |
| cargo build --release --no-default-features --features pg18 -p beyond-queue-extension | |
| PGLIB=$(docker exec "$POSTGRES_CONTAINER" pg_config --pkglibdir) | |
| docker cp target/release/libbeyond_queue_extension.so \ | |
| "${POSTGRES_CONTAINER}:${PGLIB}/beyond_queue_extension.so" | |
| docker exec "$POSTGRES_CONTAINER" psql -U postgres -d beyond_queue \ | |
| -c "CREATE SCHEMA IF NOT EXISTS queue;" | |
| docker exec -i "$POSTGRES_CONTAINER" psql -U postgres -d beyond_queue \ | |
| < beyond-queue-extension/sql/schema.sql | |
| docker exec -i "$POSTGRES_CONTAINER" psql -U postgres -d beyond_queue \ | |
| < tests/fixtures/hot_paths.sql | |
| docker exec -i "$POSTGRES_CONTAINER" psql -U postgres -d beyond_queue \ | |
| < tests/fixtures/load_pgrx_extension.sql | |
| - name: check:fmt | |
| run: mise run check:fmt | |
| - name: check:rs | |
| run: mise run check:rs | |
| - name: test:unit:rs | |
| run: mise run test:unit:rs | |
| - name: test:integration:rs | |
| env: | |
| SQLX_OFFLINE: "false" | |
| run: mise run test:integration:rs | |
| - name: test:handoff:rs | |
| env: | |
| SQLX_OFFLINE: "false" | |
| run: mise run test:handoff:rs | |
| - name: check:ts | |
| run: mise run check:ts | |
| - name: build:rs:release | |
| run: mise run build:rs:release | |
| - name: build:ts | |
| run: mise run build:ts | |
| - name: test:integration:ts | |
| run: mise run test:integration:ts | |
| - name: audit | |
| run: | | |
| cargo install cargo-audit --quiet | |
| cargo audit | |
| generate-check: | |
| name: generated files up-to-date | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: jdx/mise-action@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: generate | |
| run: mise run generate:openapi && mise run generate:types | |
| - name: check no diff | |
| run: git diff --exit-code -- openapi/v1.json sdk/ts/src/types.ts | |
| sqlx-prepare-check: | |
| name: sqlx offline cache up-to-date | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:18 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: beyond_queue_sqlx | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: jdx/mise-action@v4 | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: install sqlx-cli | |
| run: cargo install sqlx-cli --no-default-features --features postgres | |
| - name: check sqlx prepare is up to date | |
| run: cargo sqlx prepare --check --workspace | |
| env: | |
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/beyond_queue_sqlx |