Skip to content

feat: add CI github action to build and test project - #5

Merged
MostafaShraief merged 11 commits into
mainfrom
feature/dotnet-action
Apr 30, 2026
Merged

feat: add CI github action to build and test project#5
MostafaShraief merged 11 commits into
mainfrom
feature/dotnet-action

Conversation

@MostafaShraief

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

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 workflow to build and test the .NET solution on pushes and pull requests targeting main.

Changes:

  • Introduces .github/workflows/dotnet.yml to restore, build, and test on ubuntu-latest.
  • Configures the runner to install .NET SDK 9.0.x via actions/setup-dotnet.

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

Comment on lines +18 to +20
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4

Copilot AI Apr 13, 2026

Copy link

Choose a reason for hiding this comment

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

For supply-chain security, consider pinning GitHub Actions to a full commit SHA (instead of the mutable @v4 tag) for both actions/checkout and actions/setup-dotnet.

Suggested change
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup .NET
uses: actions/setup-dotnet@3f14f4970e29fbfe43b8a0123c2f7bd0d1c7db2f # v4.0.0

Copilot uses AI. Check for mistakes.
branches: [ "main" ]

jobs:
build:

Copilot AI Apr 13, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow does not set explicit permissions for GITHUB_TOKEN. To reduce risk when running on pull_request events (including from forks), consider adding least-privilege permissions (e.g., contents: read) at the workflow or job level.

Suggested change
build:
build:
permissions:
contents: read

Copilot uses AI. Check for mistakes.
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

Copilot AI Apr 13, 2026

Copy link

Choose a reason for hiding this comment

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

Consider enabling NuGet caching via actions/setup-dotnet (e.g., its built-in cache option) to speed up CI runs and reduce restore time on repeated builds.

Suggested change
dotnet-version: 9.0.x
dotnet-version: 9.0.x
cache: true

Copilot uses AI. Check for mistakes.
Comment thread .github/workflows/dotnet.yml Outdated
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should always build and test our code in Release

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we need to treat warnings as errors: -p:TreatWarningsAsErrors=true

Comment thread .github/workflows/dotnet.yml Outdated
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We need to output the test results into a structured format

@MostafaShraief
MostafaShraief merged commit 876c2da into main Apr 30, 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.

4 participants