Skip to content

Add GitHub Actions workflow for .NET build and test#15

Merged
SeifMohmmed merged 1 commit intomasterfrom
feature/application-layer-cqrs
Apr 4, 2026
Merged

Add GitHub Actions workflow for .NET build and test#15
SeifMohmmed merged 1 commit intomasterfrom
feature/application-layer-cqrs

Conversation

@SeifMohmmed
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings April 4, 2026 15:56
@SeifMohmmed SeifMohmmed merged commit 756d8bc into master Apr 4, 2026
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 workflow intended to build, test, and publish the .NET solution in CI.

Changes:

  • Introduces .github/workflows/build.yml with steps to restore, build, test, upload TRX results, and publish.
  • Configures the workflow to run on manual dispatch and on pushes to a specified branch.
  • Sets a repo-wide DOTNET_VERSION for the workflow job.

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

Comment on lines +12 to +24
defaults:
run:
working-directory: src
steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Restore
run: dotnet restore CodeClash.sln
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The workflow sets defaults.run.working-directory: src, but all dotnet ... CodeClash.sln commands assume the solution is in the current directory. In this repo CodeClash.sln is at the repository root, so restore/build will fail with "solution file not found". Either remove the working-directory default, or change the commands to reference ../CodeClash.sln (and adjust any other relative paths accordingly).

Copilot uses AI. Check for mistakes.
Comment on lines +23 to +33
- name: Restore
run: dotnet restore CodeClash.sln

- name: Build
run: >
dotnet build CodeClash.sln
--configuration Release
--no-restore
-p:TreatWarningsAsErrors=true
-p:EnforceCodeStyleInBuild=true

Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

dotnet restore/build/test/publish CodeClash.sln will attempt to build every project in the solution, including docker-compose.dcproj (uses Sdk="Microsoft.Docker.Sdk"). That SDK typically isn't available on ubuntu-latest, so the workflow is likely to fail even if the .sln path issue is fixed. Consider building/publishing the actual .NET projects directly (e.g., the API csproj), or exclude the docker-compose project from the CI build path.

Copilot uses AI. Check for mistakes.
workflow_dispatch:
push:
branches:
- master
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The workflow is configured to run on pushes to master, but this PR appears to be targeting main. If the default branch is main, this workflow won't run on normal pushes. Update the branch filter to main (or include both main and master if you need to support both).

Suggested change
- master
- main

Copilot uses AI. Check for mistakes.
workflow_dispatch:
push:
branches:
- master
Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

CI currently won't run for pull requests (only workflow_dispatch and push). Adding a pull_request trigger helps catch build/test issues before merge and is typically expected for a build workflow.

Suggested change
- master
- master
pull_request:
branches:
- master

Copilot uses AI. Check for mistakes.
Comment on lines +34 to +42
- name: Test
run: >
dotnet test CodeClash.sln
--configuration Release
--no-restore
--no-build
--verbosity normal
--logger "trx;LogFileName=test-results.trx"

Copy link

Copilot AI Apr 4, 2026

Choose a reason for hiding this comment

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

The repo doesn't contain any test projects (no csproj references Microsoft.NET.Test.Sdk), so dotnet test CodeClash.sln is likely to fail (or at best provide no meaningful signal). Consider either targeting specific test projects once they exist, or making this step conditional/omitting it until tests are added so CI doesn't fail permanently.

Copilot uses AI. Check for mistakes.
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