diff options
author | Orestis Floros <orestisflo@gmail.com> | 2021-11-06 14:16:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-06 14:16:09 +0100 |
commit | 8e9da491f4d414a7013504531aeac1a52064e0b0 (patch) | |
tree | 9ac162f6e16d64081b61c55cf59f51422521a7a0 | |
parent | 7f3316269d1e8e4992d17f1ae35bd54587fb2b0f (diff) | |
parent | 680ddc7e104e5f40d8e6be5054544918d881acae (diff) | |
download | i3-8e9da491f4d414a7013504531aeac1a52064e0b0.tar.gz i3-8e9da491f4d414a7013504531aeac1a52064e0b0.zip |
Merge pull request #4648 from orestisfl/formatting-new-action
Move clang-format and safe-wrappers check in new job
-rw-r--r-- | .github/workflows/main.yml | 22 | ||||
-rwxr-xr-x | travis/check-formatting.sh | 6 | ||||
-rw-r--r-- | travis/travis-base-386.Dockerfile | 3 | ||||
-rw-r--r-- | travis/travis-base-ubuntu-386.Dockerfile | 3 | ||||
-rw-r--r-- | travis/travis-base-ubuntu.Dockerfile | 3 | ||||
-rw-r--r-- | travis/travis-base.Dockerfile | 3 |
6 files changed, 18 insertions, 22 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e106776e..0bba6a04 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -25,8 +25,6 @@ jobs: steps: - uses: actions/checkout@v2 - run: git fetch --prune --unshallow - - name: check & print release notes - run: ./release-notes/generator.pl - name: construct container name run: | echo "BASENAME=i3wm/travis-base:$(date +'%Y-%m')-$(./travis/ha.sh travis/travis-base.Dockerfile)" >> $GITHUB_ENV @@ -47,12 +45,6 @@ jobs: echo "::group::Ubuntu i386" ./travis/skip-pkg.sh || docker pull ${{ env.BASENAME_UBUNTU_386 }} || ./travis/docker-build-and-push.sh ${{ env.BASENAME_UBUNTU_386 }} travis/travis-base-ubuntu-386.Dockerfile echo "::endgroup::" - - name: verify safe wrapper functions are used - run: | - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${{ env.BASENAME }} ./travis/check-safe-wrappers.sh - - name: verify code formatting - run: | - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${{ env.BASENAME }} ./travis/check-formatting.sh - name: build i3 run: | docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${{ env.BASENAME }} /bin/sh -c 'rm -rf build; mkdir -p build && cd build && CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Werror -fno-common" meson .. -Ddocs=true -Dmans=true -Db_sanitize=address && ninja -v' @@ -94,3 +86,17 @@ jobs: - name: push docs to GitHub pages run: | ./travis/skip-pkg.sh || travis/deploy-github-pages.sh + formatting: + name: Check formatting + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: check & print release notes + run: ./release-notes/generator.pl + - name: Install dependencies + run: | + sudo apt-get install -y clang-format-10 + - name: Check formatting + run: clang-format-10 --dry-run --Werror $(git ls-files '*.c' '*.h') + - name: Verify safe wrapper functions are used + run: ./travis/check-safe-wrappers.sh diff --git a/travis/check-formatting.sh b/travis/check-formatting.sh deleted file mode 100755 index 3424513f..00000000 --- a/travis/check-formatting.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -set -e -set -x - -clang-format-9 -i $(find . -name "*.[ch]" | tr '\n' ' ') && git diff --exit-code || (echo 'Code was not formatted using clang-format!'; false) diff --git a/travis/travis-base-386.Dockerfile b/travis/travis-base-386.Dockerfile index fc035034..fab1a48f 100644 --- a/travis/travis-base-386.Dockerfile +++ b/travis/travis-base-386.Dockerfile @@ -13,12 +13,11 @@ RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry # (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now. # Install mk-build-deps (for installing the i3 build dependencies), -# clang and clang-format-9 (for checking formatting and building with clang), # lintian (for checking spelling errors), RUN linux32 apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ dpkg-dev devscripts git equivs \ - build-essential clang clang-format-9 \ + build-essential clang \ lintian && \ rm -rf /var/lib/apt/lists/* diff --git a/travis/travis-base-ubuntu-386.Dockerfile b/travis/travis-base-ubuntu-386.Dockerfile index 747330aa..a66d58a2 100644 --- a/travis/travis-base-ubuntu-386.Dockerfile +++ b/travis/travis-base-ubuntu-386.Dockerfile @@ -13,12 +13,11 @@ RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry # (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now. # Install mk-build-deps (for installing the i3 build dependencies), -# clang and clang-format-9 (for checking formatting and building with clang), # lintian (for checking spelling errors), RUN linux32 apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ dpkg-dev devscripts git equivs \ - build-essential clang clang-format-9 \ + build-essential clang \ lintian && \ rm -rf /var/lib/apt/lists/* diff --git a/travis/travis-base-ubuntu.Dockerfile b/travis/travis-base-ubuntu.Dockerfile index 8a728af3..9ee9d355 100644 --- a/travis/travis-base-ubuntu.Dockerfile +++ b/travis/travis-base-ubuntu.Dockerfile @@ -13,13 +13,12 @@ RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry # (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now. # Install mk-build-deps (for installing the i3 build dependencies), -# clang and clang-format-9 (for checking formatting and building with clang), # lintian (for checking spelling errors), # test suite dependencies (for running tests) RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ dpkg-dev devscripts git equivs \ - build-essential clang clang-format-9 \ + build-essential clang \ lintian && \ rm -rf /var/lib/apt/lists/* diff --git a/travis/travis-base.Dockerfile b/travis/travis-base.Dockerfile index e5552c14..da5531ff 100644 --- a/travis/travis-base.Dockerfile +++ b/travis/travis-base.Dockerfile @@ -11,13 +11,12 @@ RUN echo 'APT::Acquire::Retries "5";' > /etc/apt/apt.conf.d/80retry # (3608 kB/s)). Hence, let’s stick with httpredir.debian.org (default) for now. # Install mk-build-deps (for installing the i3 build dependencies), -# clang and clang-format-9 (for checking formatting and building with clang), # lintian (for checking spelling errors), # test suite dependencies (for running tests) RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ dpkg-dev devscripts git equivs \ - build-essential clang clang-format-9 \ + build-essential clang \ lintian \ libmodule-install-perl libanyevent-perl libextutils-pkgconfig-perl xcb-proto cpanminus xvfb xserver-xephyr xauth libinline-perl libinline-c-perl libxml-simple-perl libmouse-perl libmousex-nativetraits-perl libextutils-depends-perl perl libtest-deep-perl libtest-exception-perl libxml-parser-perl libtest-simple-perl libtest-fatal-perl libdata-dump-perl libtest-differences-perl libxml-tokeparser-perl libipc-run-perl libxcb-xtest0-dev libx11-xcb-perl libjson-xs-perl x11-xserver-utils && \ rm -rf /var/lib/apt/lists/* |