From a2b555e096f7d401b5d8e877a6b5e81ff81c747a Mon Sep 17 00:00:00 2001 From: embeddedt <42941056+embeddedt@users.noreply.github.com> Date: Mon, 22 Nov 2021 08:52:18 -0500 Subject: [PATCH] ci add workflow to check code formatting --- .github/workflows/check_style.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/check_style.yml diff --git a/.github/workflows/check_style.yml b/.github/workflows/check_style.yml new file mode 100644 index 000000000..b879a3405 --- /dev/null +++ b/.github/workflows/check_style.yml @@ -0,0 +1,24 @@ +name: Verify code formatting +on: + push: + pull_request: + +jobs: + verify-formatting: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + persist-credentials: false + fetch-depth: 0 + - name: Install astyle + run: | + sudo add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu `lsb_release -sc` main universe restricted multiverse" + sudo apt-get update -y -qq + sudo apt-get install astyle + - name: Format code + run: ./code-format.sh + working-directory: scripts + - name: Check that repository is clean + run: git diff --exit-code || (echo "Please apply the preceding diff to your code or run scripts/code-format.sh"; false)