summaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorJRPan <[email protected]>2024-08-16 11:16:06 -0400
committerGitHub <[email protected]>2024-08-16 15:16:06 +0000
commit42a0cde4b463794d041b544309afb69c315f78bc (patch)
treeacc2196fb5157f7167de0318bb3aa1a20a7f70af /.github
parent081da0abacbc3595b090094b1a66fc37d35bd82a (diff)
remove unused & unintilized variables & format automation (#69)
* run formatter only on PR * remove unused & unintilized variables * fix signed & unsigned comparison warning * enable merge queue * resolve conflict * in formatter, checkout the forked repo, not the base repo in PR * Try to use jenkins for formatter * Automated Format --------- Co-authored-by: purdue-jenkins <[email protected]>
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/main.yml29
1 files changed, 12 insertions, 17 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 39f65c9..8e0ae23 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -4,7 +4,6 @@ name: Short-Tests
# Controls when the workflow will run
on:
- # Triggers the workflow on push or pull request events but only for the mydev branch
push:
branches-ignore:
- "gh-readonly-queue**"
@@ -86,25 +85,21 @@ jobs:
- name: Run Simulation
run: /bin/bash $GITHUB_WORKSPACE/short-tests.sh
format-code:
- runs-on: ubuntu-latest
+ if: github.event_name == 'pull_request'
+ runs-on: tgrogers-raid
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
- # …
+ with:
+ ref: ${{github.event.pull_request.head.ref}}
+ repository: ${{github.event.pull_request.head.repo.full_name}}
+ ssh-key: ''
+
- name: Run clang-format
run: |
- sudo apt-get install -y clang-format
+ git config user.name "purdue-jenkins"
+ git config user.email "[email protected]"
+ git remote set-url origin [email protected]:${{github.event.pull_request.head.repo.full_name}}
+ git remote -v
/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
+ if git status --untracked-files=no | grep -q "nothing to commit"; then echo "No changes to commit."; else git commit -a -m "Automated Format"; git push; fi