From dab788a99bda44735699086a6f7557dca6de47ab Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Mon, 17 Jan 2022 15:02:04 +0100 Subject: [PATCH] auth CI: do swagger syntax check --- .github/workflows/build-and-test-all.yml | 11 +++++++++++ tasks.py | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/build-and-test-all.yml b/.github/workflows/build-and-test-all.yml index aa873b167f..db430a8f44 100644 --- a/.github/workflows/build-and-test-all.yml +++ b/.github/workflows/build-and-test-all.yml @@ -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 diff --git a/tasks.py b/tasks.py index 86a6028f39..7ac2dbf719 100644 --- 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']: -- 2.47.2