diff --git a/.github/actions/setup-restore-build/action.yml b/.github/actions/setup-restore-build/action.yml new file mode 100644 index 000000000..487f2b70c --- /dev/null +++ b/.github/actions/setup-restore-build/action.yml @@ -0,0 +1,17 @@ +name: 'Setup, Restore, and Build Solution' +description: 'Checks out code, sets up .NET, restores NuGet packages, and builds the solution for CI jobs.' +runs: + using: "composite" + steps: + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + global-json-file: ./global.json + + - name: NuGet Restore + shell: pwsh + run: dotnet restore + + - name: Build + shell: pwsh + run: dotnet build --no-restore --configuration Release /p:Deterministic=true /p:UseSharedCompilation=false /p:BuildInParallel=false /nodeReuse:false /bl:./artifacts/logs/release/build.release.binlog diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 293f80abf..69d1b2e0e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,10 +11,9 @@ on: merge_group: branches: - main - workflow_call: # Allow to be called from the release workflow schedule: - - cron: '31 15 * * 0' # Run periodically to keep CodeQL database updated + - cron: '0 3 * * *' # Nightly run for performance validation permissions: security-events: write # required for CodeQL @@ -25,7 +24,7 @@ permissions: jobs: build: strategy: - fail-fast: false # Run all OSes, even if one fails, to help narrow down issues that only impact some platforms + fail-fast: false matrix: os: [windows-11-arm, ubuntu-24.04-arm] @@ -38,18 +37,10 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # avoid shallow clone so nbgv can do its work + fetch-depth: 0 - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - global-json-file: ./global.json - - - name: NuGet Restore - run: dotnet restore - - - name: Build - run: dotnet build --no-restore --configuration Release /p:Deterministic=true /p:UseSharedCompilation=false /p:BuildInParallel=false /nodeReuse:false /bl:./artifacts/logs/release/build.release.binlog + - name: Setup, Restore, and Build Solution + uses: ./.github/actions/setup-restore-build - name: Test run: dotnet test --no-build --configuration Release --settings ./build/targets/tests/test.runsettings @@ -96,7 +87,7 @@ jobs: run: cat artifacts/TestResults/coverage/SummaryGithub.md >> $GITHUB_STEP_SUMMARY shell: bash - - name: Upload coverage data to Codacy + - name: Upload coverage data to Codacy if: ${{ runner.os == 'Linux' && env.IS_CODACY_COVERAGE_ALLOWED == 'true' }} uses: codacy/codacy-coverage-reporter-action@v1.3.0 with: @@ -118,10 +109,29 @@ jobs: ./artifacts/package if-no-files-found: error + performance: + if: github.event_name == 'schedule' && github.ref == 'refs/heads/main' + strategy: + fail-fast: false + matrix: + os: [windows-11-arm, ubuntu-24.04-arm, ubuntu-latest, windows-latest, macos-latest] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Setup, Restore, and Build Solution + uses: ./.github/actions/setup-restore-build + - name: Validate performance shell: pwsh - # Runs on both Linux and Windows, with ETL disabled on non-Windows - if: ${{ runner.os == 'Linux' || runner.os == 'Windows' }} + # BenchmarkDotNet settings: + # --warmupCount 2: Two warmup iterations to allow JIT and runtime optimizations to stabilize before measurement. + # --invocationCount 15: Fifteen measured iterations for statistically meaningful results and to reduce noise. + # These values balance CI cost and reliability, as recommended in issue #553. run: ${{ github.workspace }}/build/scripts/perf/PerfCore.ps1 -v diag -diff -ci - name: Upload performance files diff --git a/.github/workflows/semantic-pr-check.yml b/.github/workflows/semantic-pr-check.yml new file mode 100644 index 000000000..789110c96 --- /dev/null +++ b/.github/workflows/semantic-pr-check.yml @@ -0,0 +1,17 @@ +name: "Semantic PR Check" + +on: + pull_request: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build/scripts/perf/RunPerfTests.ps1 b/build/scripts/perf/RunPerfTests.ps1 index a917765d9..04fcad933 100644 --- a/build/scripts/perf/RunPerfTests.ps1 +++ b/build/scripts/perf/RunPerfTests.ps1 @@ -22,7 +22,7 @@ try { $projectFullPath = Join-Path $perftestRootFolder $project & dotnet restore $projectFullPath -verbosity detailed & dotnet build -c Release --no-incremental $projectFullPath - $comandArguments = "run -c Release --no-build --project $projectFullPath -- --warmupCount 2 --invocationCount 1 --runOncePerIteration --memory --exporters JSON --artifacts $output" + $comandArguments = "run -c Release --no-build --project $projectFullPath -- --warmupCount 2 --invocationCount 15 --runOncePerIteration --memory --exporters JSON --artifacts $output" if ($ci) { $comandArguments = "$comandArguments --stopOnFirstError --keepFiles" }