The GrindCore.net project utilizes GitHub Actions to automate its continuous integration and delivery (CI/CD) pipelines. These workflows ensure cross-platform compatibility across a wide range of Runtime Identifiers (RIDs) and facilitate the automated publishing of the library to NuGet.
The Run Unit Tests workflow implements a build-once/test-many topology. It compiles the test runner once for all supported platforms and then distributes those artifacts to various runners (including self-hosted and emulated environments) to verify native interop across different architectures.
The workflow is divided into a single build job and multiple platform-specific test jobs. The build_all_platforms job uses dotnet publish with specific -r (Runtime Identifier) flags to produce binaries for each target .github/workflows/test.yaml56-80 It specifically targets net10.0 for the test execution .github/workflows/test.yaml73-80
"Run Unit Tests" uses actions/upload-artifact to pass built binaries from the initial Ubuntu builder to the target execution environments .github/workflows/test.yaml82-128
| RID | Configuration | Native Asset Handling |
|---|---|---|
linux-arm64 | Release | Manual copy from runtimes/linux-arm64/native/* .github/workflows/test.yaml152 |
linux-arm | Debug | QEMU emulation via qemu-user-static .github/workflows/test.yaml173-180 |
win-x86 | Debug | Execution on windows-latest .github/workflows/test.yaml268 |
osx-arm64 | Release | Execution on macos-14 .github/workflows/test.yaml215 |
The following diagram illustrates how the build_all_platforms job feeds the specialized test jobs.
CI Data Flow: Build to Test Jobs
Sources: .github/workflows/test.yaml55-156 .github/workflows/test.yaml159-180
The workflow supports workflow_dispatch with boolean inputs for every supported platform (e.g., linux-arm64, win-x86, osx-x64). This allows developers to trigger tests for specific architectures without running the entire suite .github/workflows/test.yaml12-53 Each test job contains an if condition checking these inputs .github/workflows/test.yaml132
ubuntu-24.04-arm for native ARM64 execution .github/workflows/test.yaml133linux-arm, the workflow installs qemu-user-static and binfmt-support to execute 32-bit ARM binaries on an x64 or ARM64 host .github/workflows/test.yaml173-180GrindCore.Tests.Runtime is executed as a standalone binary in these jobs, the workflow manually copies native libraries from the runtimes/{RID}/native/ directory to the execution root to ensure P/Invoke calls find the necessary .so, .dll, or .dylib files .github/workflows/test.yaml151-154Sources: .github/workflows/test.yaml1-268
The Publish NuGet Package workflow handles the creation and distribution of the official GrindCore.net NuGet package. It is triggered manually via workflow_dispatch .github/workflows/publish.yaml4-5
The workflow follows a standard .NET build and pack lifecycle:
dotnet build in Release configuration .github/workflows/publish.yaml35-36dotnet pack, which bundles the multi-targeted assemblies and the native assets located in the runtimes/ folder into a .nupkg file .github/workflows/publish.yaml38-39upload_to_nuget input is true, the workflow pushes the package to api.nuget.org using the NUGET_API_KEY stored in GitHub Secrets .github/workflows/publish.yaml50-53Publishing Pipeline
Sources: .github/workflows/publish.yaml1-53
NUGET_API_KEY must be configured in the repository secrets to allow the dotnet nuget push command to authenticate .github/workflows/publish.yaml53main or experimental feature branches .github/workflows/publish.yaml6-10Sources: .github/workflows/publish.yaml1-54