Преглед на файлове

Merge pull request #2688 from DDRBoxman/githubformat

CI: Move clang format check into a seperate github workflow
Colin Edwards преди 5 години
родител
ревизия
1627623f4d
променени са 5 файла, в които са добавени 50 реда и са изтрити 22 реда
  1. 48 0
      .github/workflows/clang-format.yml
  2. 0 5
      CI/before-script-linux.sh
  3. 0 5
      CI/before-script-osx.sh
  4. 1 11
      CI/install-dependencies-linux.sh
  5. 1 1
      CI/install-dependencies-osx.sh

+ 48 - 0
.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 

+ 0 - 5
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

+ 0 - 5
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 \

+ 1 - 11
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

+ 1 - 1
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