Skip to content

Add GitHub Actions CI/CD pipeline#534

Merged
Nucs merged 2 commits intomasterfrom
gh-actions
Feb 8, 2026
Merged

Add GitHub Actions CI/CD pipeline#534
Nucs merged 2 commits intomasterfrom
gh-actions

Conversation

@Nucs
Copy link
Member

@Nucs Nucs commented Feb 8, 2026

Summary

  • Add .github/workflows/build-and-release.yml — full CI/CD pipeline with 4 jobs: test (3 OSes), build-nuget, create-release, publish-nuget
  • Suppress ~7,600 cosmetic build warnings (XML doc comments, lowercase np class name) to keep annotations clean
  • Exclude known-failing tests via TEST_FILTER so the pipeline starts green (bugs tracked in OpenBugs.cs)

Details

Triggers: push to master, PR to master, tag v*, manual workflow_dispatch

Tag releases: Pushing a v* tag runs the full pipeline — tests on all 3 OSes, builds NuGet packages for NumSharp + NumSharp.Bitmap, creates a GitHub Release with .nupkg + .sha256 assets, and publishes to nuget.org (requires NUGETAPIKEY secret).

Prerelease detection: Tags with hyphens (e.g., v1.0.0-rc1) → prerelease: true. Without → prerelease: false.

Warning suppression: Uses -p:NoWarn with %3B-encoded semicolons (MSBuild CLI quoting) to suppress XML doc warnings (CS1570-CS1591, CS1711, CS1734), CS8981 (lowercase type name np), and NU5048 (PackageIconUrl deprecated). Real code warnings preserved.

Test plan

Exhaustively verified on Nucs/NumSharp-dev test repository:

  • workflow_dispatch — 3 OSes green, publish jobs skipped
  • Regression detection — deliberate failing test → all 3 OSes fail red
  • PR trigger — 3 OSes green, publish jobs skipped
  • Stable release tag (v0.50.0) — full pipeline with release assets
  • Prerelease flag correct (prerelease: false for non-hyphenated tag)
  • Missing NUGETAPIKEY — clear error, doesn't crash parallel jobs
  • Warning suppression — annotations reduced from ~120 to ~30 per run
  • All test artifacts cleaned up after verification

Closes #533

Nucs added 2 commits February 8, 2026 14:04
Single workflow with 4 jobs:

test (matrix: windows + ubuntu + macos, .NET 8 + 10 preview):
  - Builds and runs all tests on 3 OSes x 2 TFMs
  - Excludes 49 known-failing tests via TEST_FILTER env var:
    OpenBugs (38), NpAnyTest (8), np_all_axis_Test (4), Issue448 (2),
    13 specific IndexingTest methods (fancy indexing/mask bugs)
  - Excludes BitmapWithAlphaTests on non-Windows (System.Drawing.Common
    is Windows-only on .NET 6+)
  - New test failures will correctly fail the pipeline and block merges
  - Filter is documented: remove exclusions as bugs are fixed

build-nuget (on v* tags, after test):
  - Packs NumSharp and NumSharp.Bitmap into .nupkg with version from tag
  - Version extraction: v1.2.3-beta -> Version=1.2.3-beta, AssemblyVersion=1.2.3
  - Embeds commit SHA via SourceRevisionId

create-release (on v* tags, after build-nuget):
  - Creates GitHub Release with .nupkg + SHA256 checksum assets
  - Detects prerelease from version suffix (any hyphen)
  - Auto-generates changelog + structured install instructions body

publish-nuget (on v* tags, after build-nuget, parallel to create-release):
  - Pushes all .nupkg to nuget.org via NUGETAPIKEY secret
  - Uses --skip-duplicate for idempotency

Triggers: push/PR to master/main, v* tags, workflow_dispatch (manual)

Tested on Nucs/NumSharp-dev — all 3 OS test jobs pass green.
NumSharp generates ~7,600 noisy build warnings that get picked up by
GitHub Actions' MSBuild problem matcher and displayed as annotations,
drowning out real issues. This adds -p:NoWarn to all build/pack steps
via a centralized DOTNET_NOWARN env var.

Uses %3B (URL-encoded semicolons) because MSBuild CLI treats raw ;
and , as property separators — a known MSBuild quoting issue.

Suppressed warning categories:

XML doc warnings (~7,200 instances — 83% of all warnings):
- CS1570: Badly formed XML in doc comments
- CS1571: Duplicate param tag
- CS1572: Param tag for non-existent parameter
- CS1573: Missing param tag
- CS1574: Unresolvable cref
- CS1587: XML comment not placed on valid element
- CS1591: Missing XML comment on public type/member
- CS1711: Typeparam for non-existent param
- CS1734: Paramref refers to non-existent param

Other cosmetic noise:
- CS8981: Type name only contains lowercase chars (360 instances) —
  intentional for NumPy API compatibility (class 'np')
- NU5048: PackageIconUrl deprecated (2 instances)

Preserved warnings (still visible in CI):
- CS0162: Unreachable code (860)
- CS0168/CS0219: Unused variables (128)
- CA1416: Platform compatibility (380)
- CS0109/CS0628/CS0659/CS0661/CS0693: Miscellaneous code issues
@Nucs Nucs merged commit 535a368 into master Feb 8, 2026
4 of 7 checks passed
@Nucs Nucs deleted the gh-actions branch February 8, 2026 12:14
@Nucs Nucs added the infrastructure CI/CD, build system, testing framework, tooling label Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

infrastructure CI/CD, build system, testing framework, tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GitHub Actions CI/CD pipeline

1 participant