Skip to content

Commit 3fa4b2a

Browse files
committed
Add check-api-reference makefile command
1 parent 0d5d133 commit 3fa4b2a

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

.github/workflows/test-on-push.yml

+6
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v3
1414
- run: make test-e2e
15+
16+
check-api-reference:
17+
runs-on: ubuntu-22.04
18+
steps:
19+
- uses: actions/checkout@v3
20+
- run: make check-api-reference

Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ start-dev: build-dev ## Starts development environment
2727
clean-dev: ## Cleans development environment
2828
$(COMPOSE_APP_DEV) down --remove-orphans
2929

30-
update-openapi-schemas: ## Updates OpenAPI schemas in docs site
31-
curl localhost:5000/swagger/v1/swagger.json -o docs/docs/api-reference/difficalcy-osu.json
32-
curl localhost:5001/swagger/v1/swagger.json -o docs/docs/api-reference/difficalcy-taiko.json
33-
curl localhost:5002/swagger/v1/swagger.json -o docs/docs/api-reference/difficalcy-catch.json
34-
curl localhost:5003/swagger/v1/swagger.json -o docs/docs/api-reference/difficalcy-mania.json
30+
update-api-reference: ## Updates OpenAPI schemas in docs site
31+
@scripts/update-api-reference.sh
32+
33+
check-api-reference: ## Checks OpenAPI schemas are updated
34+
@scripts/check-api-reference.sh
3535

3636
build-docs: ## Builds documentation site
3737
$(COMPOSE_RUN_DOCS) build --strict --clean

scripts/check-api-reference.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
diff -q docs/docs/api-reference/difficalcy-osu.json <(curl --silent localhost:5000/swagger/v1/swagger.json)
5+
diff -q docs/docs/api-reference/difficalcy-taiko.json <(curl --silent localhost:5001/swagger/v1/swagger.json)
6+
diff -q docs/docs/api-reference/difficalcy-catch.json <(curl --silent localhost:5002/swagger/v1/swagger.json)
7+
diff -q docs/docs/api-reference/difficalcy-mania.json <(curl --silent localhost:5003/swagger/v1/swagger.json)

scripts/update-api-reference.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
curl localhost:5000/swagger/v1/swagger.json -o docs/docs/api-reference/difficalcy-osu.json
5+
curl localhost:5001/swagger/v1/swagger.json -o docs/docs/api-reference/difficalcy-taiko.json
6+
curl localhost:5002/swagger/v1/swagger.json -o docs/docs/api-reference/difficalcy-catch.json
7+
curl localhost:5003/swagger/v1/swagger.json -o docs/docs/api-reference/difficalcy-mania.json

0 commit comments

Comments
 (0)