From 22a684d9e8bc4232302326b1422b4118cde16757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Mon, 18 Oct 2021 07:24:54 +0200 Subject: [PATCH] moved uncrustify into a separate GitHub action (#3515) --- .github/workflows/CI-unixish.yml | 18 ---------------- .github/workflows/format.yml | 37 ++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/format.yml diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml index 7b4798d01..9caf53a76 100644 --- a/.github/workflows/CI-unixish.yml +++ b/.github/workflows/CI-unixish.yml @@ -22,20 +22,6 @@ jobs: with: python-version: '3.10' - - name: Cache uncrustify - uses: actions/cache@v2 - id: cache-uncrustify - with: - path: | - ~/uncrustify - key: ${{ runner.os }}-uncrustify - - - name: build uncrustify - if: steps.cache-uncrustify.outputs.cache-hit != 'true' - run: | - wget https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.72.0.tar.gz - tar xzvf uncrustify-0.72.0.tar.gz && cd uncrustify-uncrustify-0.72.0 && mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make -j$(nproc) -s && mkdir ~/uncrustify && cp uncrustify ~/uncrustify/ - - name: Install missing software on ubuntu 18.04 if: matrix.os == 'ubuntu-18.04' run: | @@ -68,10 +54,6 @@ jobs: with: modules: 'qtcharts' - - name: Uncrustify check - run: | - ~/uncrustify/uncrustify -c .uncrustify.cfg -l CPP --check */*.cpp */*.h - - name: Test CMake build run: | mkdir cmake.output diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 000000000..8d5f8a19b --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,37 @@ +# Syntax reference https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions +# Environment reference https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners +name: format + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + + - name: Cache uncrustify + uses: actions/cache@v2 + id: cache-uncrustify + with: + path: | + ~/uncrustify + key: ${{ runner.os }}-uncrustify + + - name: build uncrustify + if: steps.cache-uncrustify.outputs.cache-hit != 'true' + run: | + wget https://github.com/uncrustify/uncrustify/archive/refs/tags/uncrustify-0.72.0.tar.gz + tar xzvf uncrustify-0.72.0.tar.gz && cd uncrustify-uncrustify-0.72.0 + mkdir build + cd build + cmake -DCMAKE_BUILD_TYPE=Release .. + make -j$(nproc) -s + mkdir ~/uncrustify + cp uncrustify ~/uncrustify/ + + - name: Uncrustify check + run: | + ~/uncrustify/uncrustify -c .uncrustify.cfg -l CPP --check */*.cpp */*.h