Update README.md #415
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |