From 8dee1f074221b72eb0c49979aa54c327bade1ba7 Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Sun, 28 Dec 2025 17:19:26 -0800 Subject: [PATCH 1/2] Add: Implement .NET CI workflow for build and test automation --- .github/workflows/dotnet-ci.yml | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/dotnet-ci.yml diff --git a/.github/workflows/dotnet-ci.yml b/.github/workflows/dotnet-ci.yml new file mode 100644 index 0000000..05fc75f --- /dev/null +++ b/.github/workflows/dotnet-ci.yml @@ -0,0 +1,39 @@ +name: .NET CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build-and-test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ ubuntu-latest, windows-latest, macos-latest ] + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Cache NuGet packages + uses: actions/cache@v4 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} + restore-keys: | + ${{ runner.os }}-nuget- + + - name: Restore + run: dotnet restore MyNumberNET.sln + + - name: Build + run: dotnet build MyNumberNET.sln --configuration Release --no-restore + + - name: Test + run: dotnet test MyNumberNET.sln --configuration Release --no-build --verbosity normal From 198696deb120ff4a4d13da43be05757866382269 Mon Sep 17 00:00:00 2001 From: Hideki Saito Date: Sun, 28 Dec 2025 17:22:26 -0800 Subject: [PATCH 2/2] Potential fix for code scanning alert no. 3: Workflow does not contain permissions Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/dotnet-ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/dotnet-ci.yml b/.github/workflows/dotnet-ci.yml index 05fc75f..e93d77c 100644 --- a/.github/workflows/dotnet-ci.yml +++ b/.github/workflows/dotnet-ci.yml @@ -1,5 +1,8 @@ name: .NET CI +permissions: + contents: read + on: push: branches: [ "main" ]