Skip to content

Commit

Permalink
Format only after tests are success
Browse files Browse the repository at this point in the history
  • Loading branch information
JRPan committed Jul 14, 2024
1 parent b0c23a9 commit b263614
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,6 @@ on:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
format-code:
runs-on: ubuntu-latest
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'
build-TITANV:
runs-on: ubuntu-latest
container:
Expand Down Expand Up @@ -104,3 +82,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'

0 comments on commit b263614

Please sign in to comment.