Skip to content

Fix GitHub Actions CI and Windows/MinGW build compatibility#1237

Merged
lucaderi merged 1 commit intontop:3.0-stablefrom
mchsk:fix-gh-actions-deprecations
Mar 2, 2026
Merged

Fix GitHub Actions CI and Windows/MinGW build compatibility#1237
lucaderi merged 1 commit intontop:3.0-stablefrom
mchsk:fix-gh-actions-deprecations

Conversation

@mchsk
Copy link
Copy Markdown

@mchsk mchsk commented Mar 2, 2026

Summary

Follow-up to #1236 (MacOS Tahoe utun support). Fixes all CI failures so that every job in the test matrix passes.

GitHub Actions workflow updates

  • Upgrade deprecated actions (checkout, upload/download-artifact, codecov, gh-release) to v4/v2
  • Replace deprecated ::set-output syntax with $GITHUB_OUTPUT
  • Update runner images: remove deprecated macos-13, add macos-15, update Ubuntu to 22.04/24.04, Windows to 2022/2025
  • Make Windows coverage generation non-fatal
  • Clean up stale gcov artifacts before coverage runs on Linux
  • Disable fail-fast on test matrices to surface all failures

Windows/MinGW build fixes

  • Modernize K&R-style C function definitions to ANSI C in win32/getopt.c, getopt1.c, and getopt.h
  • Rename reserved __argc/__argv parameter names in getopt.h to avoid conflicts with Windows runtime symbols
  • Fix implicit declarations: GetAdaptersInfo (add iphlpapi.h), getenv (add stdlib.h), _byteswap_ulong (add stdlib.h)
  • Fix type mismatches: setsockopt (const char* cast), CryptGenRandom (BYTE* cast), pthread_create/pthread_mutex_trylock macro signatures
  • Extend N2N_THREAD_RETURN_DATATYPE/N2N_THREAD_PARAMETER_DATATYPE to cover __MINGW32__
  • Exclude MinGW from system getopt.h include to use the local win32/getopt.h

Linting fixes

  • Fix flake8 E275 errors in scripts/n2n-ctl and scripts/n2n-httpd (assert syntax)
  • Fix uncrustify indentation in HASH_FIND_PEER/HASH_ADD_PEER macros

Files changed (14)

.github/workflows/tests.yml, .github/workflows/cmake-linux.yml, include/n2n.h, include/n2n_define.h, include/portable_endian.h, scripts/n2n-ctl, scripts/n2n-httpd, src/edge_utils.c, src/sn_utils.c, src/random_numbers.c, win32/getopt.c, win32/getopt.h, win32/getopt1.c, win32/n2n_win32.h

Test plan

All 20 CI jobs pass (Linux, macOS, Windows tests + binary builds + packaging).

@hamishcoleman
Copy link
Copy Markdown
Contributor

Just a quick observation. Almost all the issues you have found have been fixed for over a year in the https://github.com/n42n/n3n project

Update GitHub Actions workflow:
- Upgrade deprecated actions (checkout, upload/download-artifact,
  codecov, gh-release) to v4/v2
- Replace deprecated ::set-output with $GITHUB_OUTPUT
- Update runner images: remove deprecated macos-13, add macos-15,
  update Ubuntu to 22.04/24.04 and Windows to 2022/2025
- Make Windows coverage generation non-fatal
- Clean up stale gcov artifacts before coverage runs
- Disable fail-fast on test matrices

Fix Windows/MinGW build errors:
- Modernize K&R-style C function definitions to ANSI C in
  win32/getopt.c, getopt1.c, and getopt.h
- Rename reserved __argc/__argv parameter names in getopt.h
- Fix implicit declarations: GetAdaptersInfo (add iphlpapi.h),
  getenv (add stdlib.h), _byteswap_ulong (add stdlib.h)
- Fix type mismatches: setsockopt (const char* cast),
  CryptGenRandom (BYTE* cast), pthread_create/mutex_trylock macros
- Extend N2N_THREAD_RETURN/PARAMETER_DATATYPE to cover __MINGW32__
- Exclude MinGW from system getopt.h to use local version

Fix Python and C linting:
- Fix flake8 E275 in n2n-ctl and n2n-httpd (assert syntax)
- Fix uncrustify indentation in HASH_FIND_PEER/HASH_ADD_PEER macros

Made-with: Cursor
@mchsk mchsk force-pushed the fix-gh-actions-deprecations branch from 9cd317b to 3cad2a3 Compare March 2, 2026 23:19
@mchsk mchsk changed the title Update GitHub Actions to fix deprecation warnings Fix GitHub Actions CI and Windows/MinGW build compatibility Mar 2, 2026
@mchsk
Copy link
Copy Markdown
Author

mchsk commented Mar 2, 2026

Just a quick observation. Almost all the issues you have found have been fixed for over a year in the https://github.com/n42n/n3n project

Sure - could be. I just fixed it all, so that it's clean plate now.

@lucaderi lucaderi merged commit 6a64e72 into ntop:3.0-stable Mar 2, 2026
22 checks passed
@lucaderi
Copy link
Copy Markdown
Member

lucaderi commented Mar 2, 2026

Thank you

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 21.38%. Comparing base (6dac89f) to head (3cad2a3).
⚠️ Report is 4 commits behind head on 3.0-stable.

Files with missing lines Patch % Lines
src/edge_utils.c 0.00% 2 Missing ⚠️
src/sn_utils.c 0.00% 2 Missing ⚠️
src/random_numbers.c 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@              Coverage Diff               @@
##           3.0-stable    #1237      +/-   ##
==============================================
+ Coverage       18.31%   21.38%   +3.07%     
==============================================
  Files              41       45       +4     
  Lines            8589     9161     +572     
  Branches            0     1235    +1235     
==============================================
+ Hits             1573     1959     +386     
- Misses           7016     7202     +186     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants