diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml new file mode 100644 index 000000000..737477003 --- /dev/null +++ b/.github/workflows/ci-build.yml @@ -0,0 +1,68 @@ +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 + - name: Install .NET SDK + uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json + + # 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 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 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 }