Skip to content

ci: run tests on workflow PRs and configure Dependabot - #6

Merged
atrnh merged 2 commits into
mainfrom
feat/dependabot-ci-prep
Dec 2, 2026
Merged

atrnh merged 2 commits into
mainfrom
feat/dependabot-ci-prep

Conversation

@atrnh

@atrnh atrnh commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Pull requests that only edit .github/ files currently skip the Run Tests workflow (paths-ignore excluded .github/**, and Setup .NET was gated on DotnetApp/ changes via tj-actions/changed-files). This also left the demo repository out of sync with the updated Unit 9 GitHub Actions lecture slide (hackbrightacademy/csharp-curriculum#613) and unprepared for the Dependabot PR walkthrough (hackbrightacademy/csharp-curriculum#594).

This PR updates Run Tests so pull requests touching either DotnetApp/ or .github/ reliably install .NET 8 and run the test suite, pins the .NET 8 SDK in DotnetApp/global.json so ubuntu-latest (ubuntu-26.04) does not silently roll forward to .NET 11, and adds Dependabot version update configuration for NuGet and GitHub Actions.

Changes

  • Run tests on .github/ PRs and match the lecture slide: Removed .github/** from paths-ignore (keeping 'README.md'), removed the tj-actions/changed-files step and if: condition on Setup .NET, and updated actions/setup-dotnet@v3 to actions/setup-dotnet@v4 with dotnet-version: 8.0.x (matching DotnetApp's net8.0 target framework).
  • Pin .NET 8 SDK for DotnetApp: Added DotnetApp/global.json (8.0.0, rollForward: "latestFeature"). Without global.json, ubuntu-latest (ubuntu-26.04, which preinstalls .NET SDK 11.0.100) rolled forward past 8.0.428 and failed building PettingZooApi.Tests.csproj on a .NET 11 StaticWebAssets error (Microsoft.NET.Sdk.BlazorWeb.HotReload).
  • Configure Dependabot version updates: Added .github/dependabot.yml with weekly scheduled version updates for nuget (/DotnetApp) and github-actions (/), each capped at open-pull-requests-limit: 5 to keep the demo repository tidy for classroom walkthroughs.

Validation

  • Parsed .github/workflows/build-and-test.yml and .github/dependabot.yml with Ruby YAML.safe_load, and DotnetApp/global.json with Ruby JSON.parse — all valid.
  • Linted .github/workflows/build-and-test.yml with actionlint@1.7.12 + shellcheck@0.11.0 — 0 errors, 0 warnings.
  • Verified on the first PR commit (a3c36dd) that a .github/-only PR now triggers Run Tests, and pinned DotnetApp/global.json (0c60103) so CI runs with the 8.0.x SDK installed by actions/setup-dotnet@v4.
  • Local dotnet test was not run because the local environment has .NET 9/10 SDKs (no net8.0 runtime) and no pre-restored obj/ assets; GitHub Actions on this PR verifies dotnet restore, dotnet build --no-restore, and dotnet test --no-build.

After merging

  • GitHub activates Dependabot version updates automatically once .github/dependabot.yml is on main (you can also trigger an immediate check under Insights → Dependency graph → Dependabot rather than waiting for the weekly schedule).
  • Dependabot will open real update PRs for outdated NuGet packages in /DotnetApp and GitHub Actions (actions/checkout@v4, actions/setup-dotnet@v4) in .github/workflows/, and both types of PRs will trigger Run Tests.
  • Note: Dependabot alerts and Dependabot security updates are currently disabled in repository settings (security_and_analysis.dependabot_security_updates: disabled); enable them under Settings → Code security if you also want security alerts/PRs visible during the lecture.

@atrnh
atrnh merged commit 85cfa16 into main Dec 2, 2026
1 check 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.

1 participant