From 2e31922db35a6aef3bef50adb0e9c6ef6a74ea90 Mon Sep 17 00:00:00 2001 From: fryorcraken Date: Tue, 20 Aug 2024 15:21:11 +1000 Subject: [PATCH] chore: use submodule nph in CI to check lint --- .github/workflows/ci.yml | 20 +++++--------------- Makefile | 4 ++++ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 464a2fe8e4..8ad755f795 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 diff --git a/Makefile b/Makefile index 5393567f9b..fc80a75c87 100644 --- a/Makefile +++ b/Makefile @@ -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 ###################