diff options
author | Fabian Meumertzheim <meumertzheim@code-intelligence.com> | 2021-02-01 15:38:06 +0100 |
---|---|---|
committer | Fabian Meumertzheim <meumertzheim@code-intelligence.com> | 2021-02-09 17:20:51 +0100 |
commit | 867b6a1c12045068d94f6ee723ddfabea8f49f74 (patch) | |
tree | 857b43fd60dcdff298ac20aad9eda3ec2329de6c | |
parent | bc6a1a69d79f29e3ad97309eac5deb84218bd436 (diff) | |
download | jazzer-api-867b6a1c12045068d94f6ee723ddfabea8f49f74.tar.gz |
Add formatting action
-rw-r--r-- | .github/workflows/check-formatting.yml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/.github/workflows/check-formatting.yml b/.github/workflows/check-formatting.yml new file mode 100644 index 00000000..b422be50 --- /dev/null +++ b/.github/workflows/check-formatting.yml @@ -0,0 +1,41 @@ +name: Check formatting + +# Controls when the action will run. +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + + workflow_dispatch: + +jobs: + check_formatting: + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - name: Setup Go environment + uses: actions/setup-go@v2 + with: + go-version: '^1.15.5' + + - name: Install formatters + run: | + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - + sudo apt-get install software-properties-common + sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main' + sudo apt-get install clang-format-11 + curl -sSLO https://github.com/pinterest/ktlint/releases/download/0.40.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/bin/ktlint + go get -u github.com/google/addlicense + go get github.com/bazelbuild/buildtools/buildifier + + - name: Run format.sh and print changes + run: | + ./format.sh + clang-format --version + git diff + + - name: Check for changes + run: "[ $(git status --porcelain | wc -l) -eq 0 ]" |