From 91f383d99741e8aa807954cd725fd61c792c3611 Mon Sep 17 00:00:00 2001 From: MasterLaplace Date: Thu, 7 Nov 2024 04:54:08 -0500 Subject: [PATCH] fix: update Doxygen deployment trigger and add linter workflow --- .github/workflows/deploy_doxygen_page.yml | 2 +- .github/workflows/linter.yaml | 32 +++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/linter.yaml diff --git a/.github/workflows/deploy_doxygen_page.yml b/.github/workflows/deploy_doxygen_page.yml index 03c219fe..b4817d64 100644 --- a/.github/workflows/deploy_doxygen_page.yml +++ b/.github/workflows/deploy_doxygen_page.yml @@ -1,7 +1,7 @@ name: Doxygen GitHub Pages Deploy Action on: release: - types: [published] + types: [released] jobs: generate: diff --git a/.github/workflows/linter.yaml b/.github/workflows/linter.yaml new file mode 100644 index 00000000..1d2ef02e --- /dev/null +++ b/.github/workflows/linter.yaml @@ -0,0 +1,32 @@ +name: Linter GitHub Action + +on: + push: + branches-ignore: + - 'ga-ignore-**' + - 'gh-pages' + +jobs: + lint_code: + name: Lint with clang-format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install clang-format + run: sudo apt-get install -y clang-format + + - name: Run clang-format + run: | + git ls-files -z "*.cpp" "*.hpp" | while IFS= read -rd '' f; do tail -c1 < "$f" | read -r _ || echo >> "$f"; done + find . -iname '*.hpp' -o -iname '*.cpp' | xargs clang-format -i + + - name: Set up Git and Push changes + env: + github_token: ${{ secrets.GITHUB_TOKEN }} + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git add . + git commit -m "style: apply linter" || true + git push || true