]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth CI: do swagger syntax check 11205/head
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 17 Jan 2022 14:02:04 +0000 (15:02 +0100)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Tue, 18 Jan 2022 17:58:44 +0000 (18:58 +0100)
(cherry picked from commit dab788a99bda44735699086a6f7557dca6de47ab)

.github/workflows/build-and-test-all.yml
tasks.py

index 71eaa0718c9c00b83e76f46e86b0f337861d6bda..4770b2dc22d7c927f58b2587ec61b04575a19cee 100644 (file)
@@ -179,10 +179,21 @@ jobs:
       - run: inv install-clang-runtime
       - run: inv install-auth-test-deps
       - run: inv test-ixfrdist
+  swagger-syntax-check:
+    runs-on: ubuntu-20.04
+    steps:
+      - uses: actions/checkout@v2.3.4
+        with:
+          fetch-depth: 5
+          submodules: recursive
+      - run: build-scripts/gh-actions-setup-inv  # this runs apt update+upgrade
+      - run: inv install-swagger-tools
+      - run: inv swagger-syntax-check
 
   collect:
     needs:
       - build-auth
+      - swagger-syntax-check
       - test-auth-api
       - test-auth-backend
       - test-ixfrdist
index 0edc6c3f01ac5018ec81b37e9cfa4101ef64a7fd..36c6715f778cd87191ef9c973e0d7e1ebcf8ce0c 100644 (file)
--- a/tasks.py
+++ b/tasks.py
@@ -467,6 +467,14 @@ def test_bulk_recursor(c, threads, mthreads, shards):
         c.run('chmod +x /opt/pdns-recursor/bin/* /opt/pdns-recursor/sbin/*')
         c.run(f'DNSBULKTEST=/usr/bin/dnsbulktest RECURSOR=/opt/pdns-recursor/sbin/pdns_recursor RECCONTROL=/opt/pdns-recursor/bin/rec_control THRESHOLD=95 TRACE=no ./timestamp ./recursor-test 5300 100 {threads} {mthreads} {shards}')
 
+@task
+def install_swagger_tools(c):
+    c.run('npm install -g api-spec-converter')
+
+@task
+def swagger_syntax_check(c):
+    c.run('api-spec-converter docs/http-api/swagger/authoritative-api-swagger.yaml -f swagger_2 -t openapi_3 -s json -c')
+
 # this is run always
 def setup():
     if '/usr/lib/ccache' not in os.environ['PATH']: