From: Otto Date: Tue, 16 Nov 2021 07:23:35 +0000 (+0100) Subject: Check formatting on GH X-Git-Tag: dnsdist-1.7.0-beta2~7^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7d4655b3c72104735fbf4ff88e31221d2b8d4615;p=thirdparty%2Fpdns.git Check formatting on GH --- diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml new file mode 100644 index 0000000000..3d491ba4b6 --- /dev/null +++ b/.github/workflows/formatting.yml @@ -0,0 +1,33 @@ +--- +name: 'Verify formatting and Makefile.am sort order' + +on: + push: + pull_request: + +jobs: + build: + name: verify formatting and Makefile.am sort order + # on a ubuntu-20.04 VM + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2.3.4 + with: + fetch-depth: 5 + submodules: recursive + - run: | + sudo apt-get update + sudo apt-get -qq --no-install-recommends install git clang-12 + - run: | + ./build-scripts/format-code $(find . -type f -name '*.[ch][ch]' | sort | comm -23 - .not-formatted) + git --no-pager diff + exit $(git diff | wc -l) + - run: | + exitcode=0 + for f in $(find . -type f -name 'Makefile.am'); do + ./build-scripts/test-sources-sorted.py ${f} + if [ $? -ne 0 ]; then + exitcode=1 + fi + done + exit ${exitcode}