2021-12-24 20:16:30 +08:00
|
|
|
name: clang-format
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
commit_changes:
|
|
|
|
# actions run ID
|
|
|
|
description: 'Commit clang-format changes?'
|
|
|
|
# Default value if no value is explicitly provided
|
2021-12-28 21:27:32 +08:00
|
|
|
default: 'false'
|
2021-12-24 20:16:30 +08:00
|
|
|
# Input has to be provided for the workflow to run
|
|
|
|
required: false
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
- name: Run clang-format lint
|
|
|
|
uses: DoozyX/clang-format-lint-action@v0.13
|
|
|
|
with:
|
2021-12-28 21:27:32 +08:00
|
|
|
source: './cocos ./extensions ./tests ./templates'
|
|
|
|
exclude: './thidrparty ./extensions/fairygui ./extensions/scripting/lua-bindings/auto ./extensions/spine ./tests/fairygui-tests'
|
|
|
|
extensions: 'h,cpp,c,mm'
|
2021-12-24 20:16:30 +08:00
|
|
|
clangFormatVersion: 13
|
|
|
|
inplace: True
|
|
|
|
- name: Commit clang-format changes
|
|
|
|
if: ${{ github.event.inputs.commit_changes == 'true' }}
|
|
|
|
uses: EndBug/add-and-commit@v7.5.0
|
|
|
|
with:
|
2021-12-25 09:53:34 +08:00
|
|
|
committer_name: GitHub Actions
|
|
|
|
committer_email: 41898282+github-actions[bot]@users.noreply.github.com
|
2021-12-24 20:16:30 +08:00
|
|
|
message: 'Committing clang-format changes'
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|