From 5ac02e80f652484be085ee3a92f17a34b8bd0df0 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 30 Jun 2025 10:54:51 -0700 Subject: [PATCH 1/3] Add initial GitHub Actions workflow --- .github/workflows/ci-build.yml | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 .github/workflows/ci-build.yml diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 000000000..5d75d47d9 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,64 @@ +name: CI-build + +# This workflow should trigger in the following cases: +# - The commit is any push in any branch in the repo +# - The commit is a published PR from anyone else +# +# This setup is done to avoid duplicate runs for the same exact commits, for cases when +# the PR is done from a branch in this repo, which would already trigger the "push" +# condition. This way, only PRs from forks will actually trigger the workflow. +# +# Because we can't really check these conditions from the global triggers here, they are +# added to the two root jobs below instead. If canceled, the whole workflow will stop. +on: [push, pull_request] + +jobs: + build-and-test: + if: >- + github.event_name == 'push' || + github.event.pull_request.user.login != github.repository_owner + strategy: + matrix: + configuration: [Debug, Release] + runs-on: windows-2022 + steps: + - name: Git checkout + uses: actions/checkout@v4 + + # Build the whole solution + - name: Build solution + run: dotnet build -c ${{matrix.configuration}} /bl + - name: Upload MSBuild binary log + uses: actions/upload-artifact@v4 + with: + name: msbuild_log_${{matrix.configuration}} + path: msbuild.binlog + if-no-files-found: error + + # Run tests + - name: Test solution + run: dotnet test --no--build -c ${{matrix.configuration}} -l "trx;LogFileName=VSTestResults.trx" + + # Publish test results + - name: Publish test results + uses: actions/upload-artifact@v4 + with: + name: '**/TestResults/VSTestResults.trx' + path: VSTestResults + if-no-files-found: error + + # Pack solution + - name: Pack solution + run: dotnet pack --no-build -c ${{matrix.configuration}} + + # Sign packages + - name: Sign packages + run: echo "TODO" + + # Publish build artifacts + - name: Publish package artifacts + uses: actions/upload-artifact@v4 + with: + name: 'bin/nupkg/*.nupkg' + path: Packages + if-no-files-found: error From 11cec6634289a6712bf0e4fa93e319508807b60a Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 7 Jul 2025 10:21:55 -0700 Subject: [PATCH 2/3] Delete azure-pipelines.yml --- azure-pipelines.yml | 73 --------------------------------------------- 1 file changed, 73 deletions(-) delete mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 50ebd69aa..000000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,73 +0,0 @@ -trigger: -- main -- dev/* -- rel/* - -pr: -- main -- dev/* -- rel/* - -pool: - vmImage: windows-latest - -variables: - Build.Configuration: Release - -jobs: -- job: BuildBits - displayName: Build and Test solution - timeoutInMinutes: 60 - steps: - - # Set Build Version - - script: nbgv cloud - displayName: Set NBGV version - - # Restore solution - - script: dotnet restore -p:Configuration=$(Build.Configuration) - displayName: Restore solution - - # Build solution - - script: dotnet build --no-restore -c $(Build.Configuration) - displayName: Build solution - - # Test solution # - - # Run .NET 8 unit tests - - script: dotnet test --no-build -c $(Build.Configuration) -f net8.0 -l "trx;LogFileName=VSTestResults_net8.0.trx" - displayName: Run .NET 8 unit tests - - # Run .NET 7 unit tests - - script: dotnet test --no-build -c $(Build.Configuration) -f net7.0 -l "trx;LogFileName=VSTestResults_net7.0.trx" - displayName: Run .NET 7 unit tests - - # Run .NET Framework 4.7.2 unit tests - - script: dotnet test --no-build -c $(Build.Configuration) -f net472 -l "trx;LogFileName=VSTestResults_net472.trx" - displayName: Run .NET Framework 4.7.2 unit tests - - # Publish test results - - task: PublishTestResults@2 - displayName: Publish test results - inputs: - testResultsFormat: VSTest - testResultsFiles: '**/TestResults/VSTestResults*.trx' - condition: always() - - # Pack solution - - script: dotnet pack --no-build -c $(Build.Configuration) - displayName: Pack solution - - # Sign packages - - pwsh: build/Sign-Package.ps1 - displayName: Authenticode sign packages - env: - SignClientUser: $(SignClientUser) - SignClientSecret: $(SignClientSecret) - ArtifactDirectory: bin/nupkg - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'), ne(variables['SignClientUser'], ''), ne(variables['SignClientSecret'], '')) - - # Publish build artifacts - - publish: bin/nupkg - artifact: Packages - displayName: Publish package artifacts From 7633a20fd9a7c1e165036fa27c644768c1019f10 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 7 Jul 2025 10:27:12 -0700 Subject: [PATCH 3/3] Install the .NET SDK in the workflow --- .github/workflows/ci-build.yml | 6 +++++- global.json | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 5d75d47d9..737477003 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -23,7 +23,11 @@ jobs: runs-on: windows-2022 steps: - name: Git checkout - uses: actions/checkout@v4 + uses: actions/checkout@v4 + - name: Install .NET SDK + uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json # Build the whole solution - name: Build solution diff --git a/global.json b/global.json index 00b67caef..a14813522 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.100", + "version": "9.0.301", "rollForward": "latestFeature", "allowPrerelease": false }