-
Notifications
You must be signed in to change notification settings - Fork 79
46 lines (38 loc) · 1.12 KB
/
astyle.yml
File metadata and controls
46 lines (38 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: astyle
on:
pull_request:
branches: [ master ]
push:
branches: [ master ]
workflow_dispatch:
jobs:
build:
if: github.actor != 'github-actions[bot]'
name: Formatting code
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Installing astyle
run: brew list astyle || brew install astyle
- name: Installing wxwidgets
run: brew list wxwidgets || brew install wxwidgets
- name: Configuring CMake
run: |
mkdir -p build && cd build
cmake .. \
-DXTD_BUILD_CPP_STANDARD=20 \
-DXTD_ENABLE_RUN_ASTYLE=ON
- name: Building xtd and running astyle
run: cmake --build build --target run_astyle
- name: Commit and push changes if any
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
if ! git diff --cached --quiet; then
git commit -m "Apply astyle formatting via GitHub Action"
git push origin HEAD:master
else
echo "No changes to commit"
fi