diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml new file mode 100644 index 000000000..beffb79c3 --- /dev/null +++ b/.github/workflows/clang-format.yml @@ -0,0 +1,48 @@ +name: Clang Format Check + +on: [push, pull_request] +jobs: + ubuntu64: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Install clang format + run: | + # gets us newer clang + sudo bash -c "cat >> /etc/apt/sources.list" << LLVMAPT + # 3.8 + deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main + deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main + LLVMAPT + + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - + + sudo apt-get -qq update + + sudo apt-get install -y clang-format-8 + + - name: Check the Formatting + run: | + ./formatcode.sh + ./CI/check-format.sh + + macos64: + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: 'recursive' + + - name: Install clang-format + run: | + brew install clang-format + + - name: Check the Formatting + run: | + ./formatcode.sh + ./CI/check-format.sh diff --git a/CI/before-script-linux.sh b/CI/before-script-linux.sh index 31e154410..2118a27e9 100755 --- a/CI/before-script-linux.sh +++ b/CI/before-script-linux.sh @@ -1,10 +1,5 @@ #!/bin/bash -./formatcode.sh -if ! ./CI/check-format.sh; then - exit 1 -fi - set -ex ccache -s || echo "CCache is not available." mkdir build && cd build diff --git a/CI/before-script-osx.sh b/CI/before-script-osx.sh index dda7e5866..80403bf55 100755 --- a/CI/before-script-osx.sh +++ b/CI/before-script-osx.sh @@ -3,11 +3,6 @@ export PATH=/usr/local/opt/ccache/libexec:$PATH git fetch --tags -./formatcode.sh -if ! ./CI/check-format.sh; then - exit 1 -fi - mkdir build cd build cmake -DENABLE_SPARKLE_UPDATER=ON \ diff --git a/CI/install-dependencies-linux.sh b/CI/install-dependencies-linux.sh index a84c19153..0d92fbf97 100755 --- a/CI/install-dependencies-linux.sh +++ b/CI/install-dependencies-linux.sh @@ -3,15 +3,6 @@ set -ex curl -L https://packagecloud.io/github/git-lfs/gpgkey | sudo apt-key add - -# gets us newer clang -sudo bash -c "cat >> /etc/apt/sources.list" << LLVMAPT -# 3.8 -deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main -deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-8 main -LLVMAPT - -wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - - sudo apt-get -qq update sudo apt-get install -y \ build-essential \ @@ -52,8 +43,7 @@ sudo apt-get install -y \ python3-dev \ qtbase5-dev \ libqt5svg5-dev \ - swig \ - clang-format-8 + swig # build cef wget --quiet --retry-connrefused --waitretry=1 https://cdn-fastly.obsproject.com/downloads/cef_binary_${CEF_BUILD_VERSION}_linux64.tar.bz2 diff --git a/CI/install-dependencies-osx.sh b/CI/install-dependencies-osx.sh index a800aec1d..585b731a6 100755 --- a/CI/install-dependencies-osx.sh +++ b/CI/install-dependencies-osx.sh @@ -28,7 +28,7 @@ sudo installer -pkg ./Packages.pkg -target / brew update #Base OBS Deps and ccache -brew install jack speexdsp ccache mbedtls clang-format freetype fdk-aac +brew install jack speexdsp ccache mbedtls freetype fdk-aac brew install https://gist.githubusercontent.com/DDRBoxman/9c7a2b08933166f4b61ed9a44b242609/raw/ef4de6c587c6bd7f50210eccd5bd51ff08e6de13/qt.rb brew unlink swig brew install https://gist.githubusercontent.com/DDRBoxman/4cada55c51803a2f963fa40ce55c9d3e/raw/572c67e908bfbc1bcb8c476ea77ea3935133f5b5/swig.rb