Skip to content

feat: add GitHub Actions CI/CD workflows and local test runner#6

Merged
gragra33 merged 4 commits into
developfrom
feature/github-actions
Apr 19, 2026
Merged

feat: add GitHub Actions CI/CD workflows and local test runner#6
gragra33 merged 4 commits into
developfrom
feature/github-actions

Conversation

@gragra33
Copy link
Copy Markdown
Owner

Summary

Adds full GitHub Actions CI/CD pipeline and a local test runner script for Blazing.Json.Queryable.


What's included

.github/workflows/ci.yml

  • Triggers on push to develop, feature/**, fix/**, hotfix/** and PRs targeting develop / master
  • validate-branch job (PR-only): enforces feature/, fix/, or hotfix/ prefix (or develop)
  • build-and-test job: targets net10.0 only (single TFM — no matrix needed)
    • actions/checkout@v5 · actions/setup-dotnet@v5 (10.0.x) · restore → build → test → upload .trx artifacts
    • --no-build --no-restore on dotnet test — no redundant rebuild after explicit Build step
    • Upload-artifact gated on env.RUNNING_LOCALLY == '' — skipped under act, fatal on real GitHub Actions

.github/workflows/release.yml

  • Triggers on push to master
  • Steps: restore → build → test → extract version from .csproj → guard against re-releasing an already-tagged version → pack → GitHub Release (gh CLI) → NuGet push
  • Publishes both .nupkg and .snupkg (symbols); DebugType=portable already set in project
  • Uses gh CLI for GitHub Release (no third-party actions)

ci-cd-test-run.ps1

  • Local runner with -Mode (lint / dry / ci / all) and -Workflow (ci / release / both) parameters
  • RUNNING_LOCALLY=true passed to every act invocation — prevents upload-artifact from running inside act where ACTIONS_RUNTIME_TOKEN is unavailable
  • Explicit push-event payload for Release workflow dry-run so act's default ref matches the master branch filter
  • Correct docker check: Test-Tool 'docker' before docker info; dotnet is warn-only for act-backed modes

Validation

All checks passed locally before opening this PR:

dotnet restore    ✅
dotnet build      ✅
dotnet test       ✅  487 passed, 0 failed
dotnet pack       ✅  Blazing.Json.Queryable.1.1.1.nupkg + .snupkg
actionlint        ✅  zero violations (both workflows)
act dry-run (CI)  ✅
act dry-run (Rel) ✅

Required setup (one-time, before first release)

Add NUGET_API_KEY as a repository secret:
Settings → Secrets and variables → Actions → New repository secret

  • Name: NUGET_API_KEY
  • Value: NuGet.org API key scoped to Blazing.Json.Queryable

GITHUB_TOKEN is provided automatically by GitHub Actions — no setup needed.

- ci.yml: triggers on push to develop/feature/fix/hotfix branches and PRs
  to develop/master; validates branch naming on PRs; builds and tests on
  net10.0; uploads test results (.trx) as artifacts
- release.yml: triggers on push to master; build, test, extract version,
  guard against re-releasing, pack, GitHub Release, push to NuGet.org
- ci-cd-test-run.ps1: local runner with lint/dry/ci/all modes and
  ci/release/both workflow selection; uses RUNNING_LOCALLY env var gate
  to skip upload-artifact when running under act
Copilot AI review requested due to automatic review settings April 19, 2026 11:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions CI pipeline and a release workflow for Blazing.Json.Queryable, plus a PowerShell helper to run workflow linting and act runs locally.

Changes:

  • Add CI workflow to validate branch naming on PRs, build, run tests, and upload TRX results.
  • Add release workflow to build/test/pack and publish GitHub Releases + push packages to NuGet on master.
  • Add ci-cd-test-run.ps1 to lint workflows via actionlint and execute/dry-run them via act.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
ci-cd-test-run.ps1 Local workflow runner that checks prerequisites, runs actionlint, and runs/dry-runs workflows with act.
.github/workflows/ci.yml CI pipeline for restore/build/test and test-results artifact upload, including PR branch-name validation.
.github/workflows/release.yml Release pipeline for restore/build/test/pack, GitHub Release creation, and NuGet package publishing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/release.yml Outdated
Comment thread .github/workflows/release.yml Outdated
Comment thread ci-cd-test-run.ps1 Outdated
Comment thread ci-cd-test-run.ps1
- release.yml: remove unused RUNNING_LOCALLY env block (no upload-artifact
  step in release workflow, so the variable was declared but never referenced)
- release.yml: add --no-restore to dotnet pack (Restore step already ran;
  omitting it caused an implicit redundant restore)
- ci-cd-test-run.ps1: update description wording — act uses push event so
  PR-only jobs (validate-branch) are not exercised locally; wording now
  accurately says 'approximates' rather than 'mirrors exactly'
- ci-cd-test-run.ps1: guard -Job parameter to CI workflow only; if -Job is
  supplied with -Workflow release or both, emit a clear warning and skip the
  -j flag for the Release workflow to avoid act erroring on an unknown job name
Copilot AI review requested due to automatic review settings April 19, 2026 11:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/release.yml
@gragra33 gragra33 merged commit 9bd1c7d into develop Apr 19, 2026
4 checks passed
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.

2 participants