From cb4cc68a74535df3850af3ed7c3d9b80355b031d Mon Sep 17 00:00:00 2001 From: Diego Date: Mon, 10 Jun 2024 18:21:53 +0200 Subject: [PATCH] add lint job to ci --- .github/workflows/ci.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eb48f2e428..08b5e7a504 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -90,3 +90,24 @@ jobs: nim --version nimble --version nimble test + + lint: + name: "Lint" + 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: 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} + ./nph examples libp2p tests tools *.(nim|nims|nimble) + git diff --exit-code