8888 - name : secrets-scanner
8989 type : go
9090 path : PROJECTS/intermediate/secrets-scanner
91+ # Nim
92+ - name : credential-enumeration
93+ type : nim
94+ path : PROJECTS/intermediate/credential-enumeration
9195
9296 defaults :
9397 run :
@@ -147,6 +151,17 @@ jobs:
147151 if : matrix.type == 'go'
148152 run : go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@latest
149153
154+ # Nim Setup
155+ - name : Setup Nim
156+ if : matrix.type == 'nim'
157+ uses : jiro4989/setup-nim-action@v2
158+ with :
159+ nim-version : ' 2.2.x'
160+
161+ - name : Install nph
162+ if : matrix.type == 'nim'
163+ run : nimble install -y nph
164+
150165 # Ruff Linting
151166 - name : Run ruff
152167 if : matrix.type == 'ruff'
@@ -195,6 +210,37 @@ jobs:
195210 cat golangci-output.txt
196211 continue-on-error : true
197212
213+ # Nim Linting
214+ - name : Run nph and nim check
215+ if : matrix.type == 'nim'
216+ id : nim
217+ run : |
218+ echo "Running nph format check..."
219+ NPH_OK=true
220+ NIM_OK=true
221+ if nph --check src/ > nim-output.txt 2>&1; then
222+ echo "nph: no formatting issues"
223+ else
224+ NPH_OK=false
225+ echo "nph: formatting issues found"
226+ fi
227+ echo "Running nim check..."
228+ if nim check src/harvester.nim >> nim-output.txt 2>&1; then
229+ echo "nim check: passed"
230+ else
231+ NIM_OK=false
232+ echo "nim check: failed"
233+ fi
234+ if [[ "$NPH_OK" == "true" && "$NIM_OK" == "true" ]]; then
235+ echo "NIM_PASSED=true" >> $GITHUB_ENV
236+ echo "All Nim checks passed!"
237+ else
238+ echo "NIM_PASSED=false" >> $GITHUB_ENV
239+ echo "Nim checks found issues"
240+ fi
241+ cat nim-output.txt
242+ continue-on-error : true
243+
198244 # Create Summary for Ruff
199245 - name : Create Ruff Lint Summary
200246 if : matrix.type == 'ruff'
@@ -288,6 +334,37 @@ jobs:
288334 fi
289335 } >> $GITHUB_STEP_SUMMARY
290336
337+ # Create Summary for Nim
338+ - name : Create Nim Lint Summary
339+ if : matrix.type == 'nim'
340+ run : |
341+ {
342+ echo "## Lint Results: ${{ matrix.name }}"
343+ echo ''
344+
345+ if [[ "${{ env.NIM_PASSED }}" == "true" ]]; then
346+ echo '### nph + nim check: **Passed**'
347+ echo 'No Nim issues found.'
348+ else
349+ echo '### nph + nim check: **Issues Found**'
350+ echo '<details><summary>View Nim output</summary>'
351+ echo ''
352+ echo '```'
353+ head -100 nim-output.txt
354+ echo '```'
355+ echo '</details>'
356+ fi
357+ echo ''
358+
359+ if [[ "${{ env.NIM_PASSED }}" == "true" ]]; then
360+ echo '---'
361+ echo '### All checks passed!'
362+ else
363+ echo '---'
364+ echo '### Review the issues above'
365+ fi
366+ } >> $GITHUB_STEP_SUMMARY
367+
291368 # Exit with proper status
292369 - name : Check lint status
293370 run : |
@@ -306,5 +383,10 @@ jobs:
306383 echo "Go lint checks failed"
307384 exit 1
308385 fi
386+ elif [[ "${{ matrix.type }}" == "nim" ]]; then
387+ if [[ "${{ env.NIM_PASSED }}" == "false" ]]; then
388+ echo "Nim lint checks failed"
389+ exit 1
390+ fi
309391 fi
310392 echo "All lint checks passed"
0 commit comments