ci: install uncrustify through homebrew

It will result in less CI code, and the additional CI time is
negligible.
This commit is contained in:
dundargoc 2023-04-29 13:39:36 +02:00 committed by GitHub
parent 3287fc2ba9
commit 9f2fd89948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -33,46 +33,16 @@ jobs:
if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master') if: (github.event_name == 'pull_request' && github.base_ref == 'master') || (github.event_name == 'push' && github.ref == 'refs/heads/master')
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
timeout-minutes: 10 timeout-minutes: 10
env:
CACHE_UNCRUSTIFY: ${{ github.workspace }}/.cache/uncrustify
UNCRUSTIFY_VERSION: uncrustify-0.76.0
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- name: Install dependencies
run: ./.github/scripts/install_deps.sh lua-check
- name: Set up Homebrew - name: Set up Homebrew
id: homebrew
uses: Homebrew/actions/setup-homebrew@master uses: Homebrew/actions/setup-homebrew@master
- run: | - name: Install dependencies
brew install stylua
- name: Cache uncrustify
id: cache-uncrustify
uses: actions/cache@v3
with:
path: ${{ env.CACHE_UNCRUSTIFY }}
key: ${{ env.UNCRUSTIFY_VERSION }}
- name: Clone uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: uncrustify/uncrustify
ref: ${{ env.UNCRUSTIFY_VERSION }}
path: uncrustify
- name: Install uncrustify
if: steps.cache-uncrustify.outputs.cache-hit != 'true'
run: | run: |
source_dir=uncrustify ./.github/scripts/install_deps.sh lua-check
build_dir=uncrustify/build brew install stylua uncrustify
cmake -S $source_dir -B $build_dir -G Ninja -D CMAKE_BUILD_TYPE=Release
cmake --build $build_dir
mkdir -p .cache
cp $build_dir/uncrustify ${{ env.CACHE_UNCRUSTIFY }}
- uses: ./.github/actions/cache - uses: ./.github/actions/cache
@ -82,7 +52,6 @@ jobs:
cmake --build .deps cmake --build .deps
- if: success() || failure() && steps.abort_job.outputs.status == 'success' - if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: configure
run: cmake -B build -G Ninja run: cmake -B build -G Ninja
- if: "!cancelled()" - if: "!cancelled()"
@ -111,8 +80,7 @@ jobs:
- if: success() || failure() && steps.abort_job.outputs.status == 'success' - if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: uncrustify name: uncrustify
run: | run: cmake --build build --target lintc-uncrustify
${{ env.CACHE_UNCRUSTIFY }} -c ./src/uncrustify.cfg -q --replace --no-backup $(find ./src/nvim -name "*.[ch]")
- if: success() || failure() && steps.abort_job.outputs.status == 'success' - if: success() || failure() && steps.abort_job.outputs.status == 'success'
name: suggester / uncrustify name: suggester / uncrustify