Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
55 changes: 55 additions & 0 deletions .github/workflows/validate-openapi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: OpenAPI Schema Validation

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
schemathesis:
name: Schemathesis
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ^1.25

- name: Get external dependencies
run: make edeps

- name: Generate static files package
run: make statik

- name: Get other dependencies
run: make deps

- name: Build mmsd
run: make build_mmsd

- name: Prepare test state db
run: make testdb

- name: Start mmsd
run: ./mmsd serve --hostname 0.0.0.0 --api-port 8080 -w ./test &
Comment thread
johtoblan marked this conversation as resolved.
Outdated

- name: Wait for mmsd to be ready
run: |
for i in $(seq 1 15); do
curl -sf http://localhost:8080/api/v1/healthz && echo "Server is up!" && exit 0
echo "Waiting for server... attempt $i"
sleep 2
done
echo "Server did not start in time"
exit 1

- name: Run Schemathesis
uses: schemathesis/action@v3
with:
schema: openapi3.yaml
base-url: http://localhost:8080
args: '--report-junit-path=/tmp/junit.xml'
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ WORKDIR /app
RUN chown nobody.nogroup /app
USER nobody:nogroup

ENTRYPOINT ["/app/mmsd"]
ENTRYPOINT ["/app/mmsd", "--hostname", "0.0.0.0"]
Loading