From: Peter van Dijk Date: Mon, 17 Jan 2022 14:02:04 +0000 (+0100) Subject: auth CI: do swagger syntax check X-Git-Tag: auth-4.7.0-alpha1~62^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11194%2Fhead;p=thirdparty%2Fpdns.git auth CI: do swagger syntax check --- 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']: