Merge tag 'v0.4.1' into develop #282
This file contains 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: Format_Check | |
on: | |
push: | |
branches: | |
- develop | |
- main | |
paths: | |
- .github/workflows/format_check.yml | |
- include/** | |
- scripts/** | |
- single_include/** | |
- tests/** | |
- tools/amalgamation/** | |
- CMakeLists.txt | |
- .clang-format | |
# to grant contents write permission to fork repos as well | |
pull_request_target: | |
paths: | |
- .github/workflows/format_check.yml | |
- include/** | |
- scripts/** | |
- single_include/** | |
- tests/** | |
- tools/amalgamation/** | |
- CMakeLists.txt | |
- .clang-format | |
workflow_dispatch: | |
concurrency: | |
group: ${{github.workflow}}-${{github.ref}} | |
cancel-in-progress: true | |
jobs: | |
format-check: | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{github.head_ref}} | |
token: ${{secrets.FKYAML_FORMAT_CHECK_PAT}} | |
submodules: recursive | |
- name: Run clang-format style check | |
run: ${{github.workspace}}/scripts/run_clang_format.sh | |
- name: Run amalgamation check | |
run: ${{github.workspace}}/scripts/run_amalgamation.sh | |
- name: Detect diffs caused by formatting scripts | |
id: format_diff | |
run: git diff --name-only --exit-code | |
- name: Commit and push the diffs | |
if: failure() && steps.format_diff.outcome == 'failure' | |
run: | | |
set -x | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git add . | |
git commit --author="$(git log --pretty=format:"%an <%ae>")" -m "[bot] run clang-format & amalgamation" | |
git push |