Skip to content

Add integration test workflow #11

Add integration test workflow

Add integration test workflow #11

Workflow file for this run

name: integration
# defaults:
# run:
# working-directory: lambdas
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
test:
runs-on: ubuntu-latest
env:
DATABASE_URL: "postgresql://postgres:postgres@localhost:5432/postgres"
services:
postgres:
image: ghcr.io/peopleforbikes/docker-postgis-bna:17-3.4-1
env:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Check out repository code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install uv
uses: astral-sh/setup-uv@887a942a15af3a7626099df99e897a18d9e5ab3a #v5.1.0
with:
enable-cache: true
- name: Set up Python
run: uv python install
- name: Install HURL
run: |
HURL_VERSION=6.0.0
curl --location --remote-name https://github.com/Orange-OpenSource/hurl/releases/download/$HURL_VERSION/hurl_${HURL_VERSION}_amd64.deb
sudo apt install ./hurl_${HURL_VERSION}_amd64.deb
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
- name: Seed the database
run: psql $DATABASE_URL < lambdas/tests/database-with-test-data.sql
- name: Build the API server
run: cargo build --release -p lambdas --bin axumed
- name: Start the standalone API server
run: >
BNA_API_LOG_LEVEL=debug
BNA_API_STANDALONE=1
cargo run --release -p lambdas --bin axumed &
- run: sleep 5
- name: Run the public read-only smoke-tests
run: >
hurl
--test
--variables-file tests/localhost.vars
lambdas/tests/smoke/public.hurl
- name: Install the project
run: |
cd lambdas/tests
uv sync --all-extras --dev
- name: Run Schemathesis
run: >
RUST_BACKTRACE=1
uv run st run
--base-url http://localhost:3000/
--cassette-path cassette.yaml
-vvv
-x
--show-trace
--generation-allow-x00 false
--exclude-method 'POST'
--exclude-method 'PATCH'
../../openapi-3.0.yaml