]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth CI: do swagger syntax check 11194/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>
Mon, 17 Jan 2022 19:53:56 +0000 (20:53 +0100)
.github/workflows/build-and-test-all.yml
tasks.py

index aa873b167f1a934a1364e8f861d01b80a70f7711..db430a8f44065f0ed8095d861236367a01328aee 100644 (file)
@@ -384,6 +384,17 @@ jobs:
       - run: inv install-dnsdist-test-deps
       - run: inv test-dnsdist
 
+  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
index 86a6028f3988061577775985aa62ad56cc031f24..7ac2dbf7194af1d5751deb070c69d15174fb8a24 100644 (file)
--- a/tasks.py
+++ b/tasks.py
@@ -512,6 +512,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']: