-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move code formatter to different workflow
- Loading branch information
1 parent
aac51f4
commit f614558
Showing
2 changed files
with
54 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Code Formatter | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
formatter: | ||
name: "Format Codebase" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base | ||
|
||
- name: Format with NPH | ||
# Pin nph to a specific version to avoid sudden style differences. | ||
# Updating nph version should be accompanied with running the new | ||
# version on the fluffy directory. | ||
run: | | ||
VERSION="v0.5.1" | ||
ARCHIVE="nph-linux_x64.tar.gz" | ||
curl -L "https://github.com/arnetheduck/nph/releases/download/${VERSION}/${ARCHIVE}" -o ${ARCHIVE} | ||
tar -xzf ${ARCHIVE} | ||
shopt -s extglob # Enable extended globbing | ||
./nph examples libp2p tests tools *.@(nim|nims|nimble) | ||
git diff --exit-code |