summaryrefslogtreecommitdiff
path: root/.github/workflows/main.yml
diff options
context:
space:
mode:
authorAaron Barnes <[email protected]>2024-07-16 12:33:16 -0600
committerGitHub <[email protected]>2024-07-16 18:33:16 +0000
commite1afc53b51d24afcfd8b8aab15e4ba5d99b4a772 (patch)
treeffd07cc1a81884761c5b16089b3fc5937cb58b1d /.github/workflows/main.yml
parent55419d7098a433122bf4d940cf38af17e33f045a (diff)
Auto clang format (#74)
* add automated clang formatter * Automated clang-format * use /bin/bash and add print * use default checkout ref * Format only after tests are success * Run CI on merge group --------- Co-authored-by: barnes88 <[email protected]> Co-authored-by: JRPAN <[email protected]>
Diffstat (limited to '.github/workflows/main.yml')
-rw-r--r--.github/workflows/main.yml26
1 files changed, 26 insertions, 0 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index c639ff3..39f65c9 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -6,6 +6,9 @@ name: Short-Tests
on:
# Triggers the workflow on push or pull request events but only for the mydev branch
push:
+ branches-ignore:
+ - "gh-readonly-queue**"
+ merge_group:
pull_request:
# Allows you to run this workflow manually from the Actions tab
@@ -82,3 +85,26 @@ jobs:
- uses: actions/checkout@v4
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests.sh
+ format-code:
+ runs-on: ubuntu-latest
+ needs: [build-TITANV, build-TITANV-LOCALXBAR, build-QV100, build-2060, build-3070]
+ permissions:
+ # Give the default GITHUB_TOKEN write permission to commit and push the
+ # added or changed files to the repository.
+ contents: write
+ steps:
+ - uses: actions/checkout@v4
+ # Other steps that change files in the repository go here
+ # …
+ - name: Run clang-format
+ run: |
+ sudo apt-get install -y clang-format
+ /bin/bash ./format-code.sh
+ - uses: stefanzweifel/git-auto-commit-action@v5
+ with:
+ # Optional. Commit message for the created commit.
+ # Defaults to "Apply automatic changes"
+ commit_message: Automated clang-format
+ # Optional. Option used by `git-status` to determine if the repository is
+ # dirty. See https://git-scm.com/docs/git-status#_options
+ status_options: '--untracked-files=no' \ No newline at end of file