Skip to content

Commit

Permalink
chore: use submodule nph in CI to check lint
Browse files Browse the repository at this point in the history
  • Loading branch information
fryorcraken committed Aug 20, 2024
1 parent d63e343 commit 2e31922
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
20 changes: 5 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ jobs:
export MAKEFLAGS="-j1"
export NIMFLAGS="--colors:off -d:chronicles_colors:none"
make V=1 LOG_LEVEL=DEBUG QUICK_AND_DIRTY_COMPILER=1 POSTGRES=$postgres_enabled test testwakunode2
build-docker-image:
Expand All @@ -141,25 +141,15 @@ jobs:
nim_wakunode_image: ${{ needs.build-docker-image.outputs.image }}
test_type: node-optional
debug: waku*

lint:
name: "Lint"
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 2 # In PR, has extra merge commit: ^1 = PR, ^2 = base

- name: Check nph formatting
# 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 waku tests tools apps *.@(nim|nims|nimble)
NPH=$(make print-nph-path)
"${NPH}" examples waku tests tools apps *.@(nim|nims|nimble)
git diff --exit-code
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ nph/%: build-nph
clean-nph:
rm -f $(NPH)

# To avoid hardcoding nph binary location in several places
print-nph-path:
echo "$(NPH)"

clean: | clean-nph

###################
Expand Down

0 comments on commit 2e31922

Please sign in to comment.