Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 80 additions & 0 deletions .github/workflows/bruno.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Standalone workflow for Bruno end-to-end tests.
name: bruno-e2e

on:
pull_request:
branches: [ "main" ]
paths-ignore:
- 'README.md'
- '**/README.md'

env:
GO_VERSION: stable
SQLC_VERSION: '1.29.0'

jobs:
bruno:
name: Bruno E2E
runs-on: ubuntu-latest
timeout-minutes: 25
steps:
- name: Checkout repository
uses: actions/checkout@v6

- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: xsltproc
version: 1.0

- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ env.GO_VERSION }}
cache-dependency-path: |
go.work.sum
broker/go.sum
illmock/go.sum

- name : Ensure sqlc is installed
uses: sqlc-dev/setup-sqlc@v4
with:
sqlc-version: ${{ env.SQLC_VERSION }}

- name: Generate sources
run: make generate

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 22

- name: Start Crosslink stack
run: docker compose -f bruno/docker-compose.yml up -d --build

- name: Wait for broker readiness
run: |
for i in {1..60}; do
if curl -sSf -o /dev/null http://localhost:8080/healthz; then
exit 0
fi
sleep 2
done
echo "Broker did not become ready in time"
docker compose -f bruno/docker-compose.yml ps
docker compose -f bruno/docker-compose.yml logs --no-color broker postgres illmock
exit 1

- name: Run Bruno collection (headless)
working-directory: bruno/crosslink
run: |
npx --yes @usebruno/[email protected] run \
--env LocalDev \
--env-var userPassword="dummy"

- name: Print container logs on failure
if: failure()
run: docker compose -f bruno/docker-compose.yml logs --no-color

- name: Stop Crosslink stack
if: always()
run: docker compose -f bruno/docker-compose.yml down -v --remove-orphans
2 changes: 1 addition & 1 deletion bruno/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ docker compose up

2. Launch Bruno and open the `crosslink` collection located in this directory.

3. In Bruno, load the `Local Dev` environment.
3. In Bruno, load the `LocalDev` environment.

4. Run all steps in the Bruno runner. All HTTP response codes and validations should be green.

24 changes: 1 addition & 23 deletions bruno/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,20 @@
services:
postgres:
image: postgres:latest
image: postgres:16
container_name: crosslink_postgres
environment:
POSTGRES_USER: crosslink
POSTGRES_PASSWORD: crosslink
POSTGRES_DB: crosslink
ports:
- "25432:5432"
volumes:
- ./pg_data:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U crosslink -d crosslink"]
interval: 5s
timeout: 3s
retries: 20
start_period: 5s

db-up:
profiles: ["db-up"]
build:
context: ..
dockerfile: broker/Dockerfile
container_name: crosslink_db_up
depends_on:
postgres:
condition: service_healthy
command: ["/broker", "db-up"]
environment:
DB_TYPE: postgres
DB_USER: crosslink
DB_PASSWORD: crosslink
DB_HOST: postgres
DB_DATABASE: crosslink
DB_PORT: 5432
DB_PROVISION: "true"
DB_MIGRATE: "true"

broker:
build:
context: ..
Expand Down
Loading