From 3983232d3644cb467f87aded603c31cd35df8dfd Mon Sep 17 00:00:00 2001 From: Views2k <292889387+Views2k@users.noreply.github.com> Date: Tue, 17 Nov 2026 21:37:08 -0600 Subject: [PATCH] Run fewer CI steps for documentation and test changes Verify EE now looks at the changed files. A pull request that changes only Markdown files and README screenshots gets the author check and the repository check. The installer is built only when a changed file can affect the package. A run started by hand still runs every step. --- .github/workflows/quality.yml | 42 +++++++++++++++++++++++++++++++++-- docs/WORKFLOW.md | 2 ++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/workflows/quality.yml b/.github/workflows/quality.yml index 85524d6..60fa0e2 100644 --- a/.github/workflows/quality.yml +++ b/.github/workflows/quality.yml @@ -49,10 +49,42 @@ jobs: # Merge commit messages are generated by git and name the merged branches, so only authored ones are read. git log --no-merges --format=%B "$env:BASE_SHA..$env:HEAD_SHA" | python -c "import runpy, sys; found = runpy.run_path('tools/check-repository.py')['AI_MARKER'].search(sys.stdin.read()); sys.exit(found and 'A commit message contains: ' + found.group())" if ($LASTEXITCODE) { exit $LASTEXITCODE } + # A pull request that changes only Markdown files and README screenshots gets the repository check alone. + # docs/API.md is excluded because tests/test_remote_routes.py reads it. The installer is built unless every + # changed file is a test, documentation, an issue or pull request template, or the Dependabot settings, + # none of which is packaged. A run started by hand always runs everything. + - name: Choose the checks for the changed files + id: scope + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + run: | + $tests = $true + $package = $true + if ($env:GITHUB_EVENT_NAME -eq 'pull_request') { + $files = @(git diff --name-only "$env:BASE_SHA...$env:HEAD_SHA") + if ($LASTEXITCODE) { exit $LASTEXITCODE } + if (-not $files.Count) { throw 'The pull request changes no files.' } + $documents = '\.md$|^docs/screenshots/' + $unpackaged = "$documents|^tests/|^\.github/ISSUE_TEMPLATE/|^\.github/dependabot\.yml$" + $tests = [bool]@($files | Where-Object { $_ -notmatch $documents -or $_ -eq 'docs/API.md' }).Count + $package = [bool]@($files | Where-Object { $_ -notmatch $unpackaged }).Count + $files | ForEach-Object { " $_" } + } + "Tests: $tests. Installer: $package." + "tests=$("$tests".ToLower())" >> $env:GITHUB_OUTPUT + "package=$("$package".ToLower())" >> $env:GITHUB_OUTPUT + - name: Check the repository files + if: steps.scope.outputs.tests != 'true' + run: | + python tools/check-repository.py --output (Join-Path $env:RUNNER_TEMP 'source-manifest.json') + if ($LASTEXITCODE) { exit $LASTEXITCODE } - uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0 + if: steps.scope.outputs.tests == 'true' with: global-json-file: global.json - name: Install pinned dependencies on the hosted runner + if: steps.scope.outputs.tests == 'true' run: | python -m pip install --require-hashes --only-binary=:all: -r requirements-ci.txt if ($LASTEXITCODE) { exit $LASTEXITCODE } @@ -60,17 +92,19 @@ jobs: if ($LASTEXITCODE) { exit $LASTEXITCODE } python -m pip check - name: Restore the desktop program's locked packages + if: steps.scope.outputs.tests == 'true' env: AVALONIA_TELEMETRY_OPTOUT: '1' run: | dotnet restore desktop/EtherlightingEvolved.Native.Check/EtherlightingEvolved.Native.Check.csproj --locked-mode if ($LASTEXITCODE) { exit $LASTEXITCODE } - name: Verify source and simulator workflows + if: steps.scope.outputs.tests == 'true' run: | $browser = Join-Path ${env:ProgramFiles(x86)} 'Microsoft\Edge\Application\msedge.exe' & .\tools\verify.ps1 -PythonExe @(Get-Command python -CommandType Application)[0].Source -BrowserExe $browser -OutputRoot '.\outputs\verification' - name: Keep verification results - if: always() + if: always() && steps.scope.outputs.tests == 'true' uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 with: name: verification-${{ github.sha }} @@ -83,15 +117,19 @@ jobs: outputs/verification/browser/result.json outputs/verification/browser/*.png - name: Prepare pinned installer compiler + if: steps.scope.outputs.package == 'true' run: .\tools\ci-inno.ps1 - name: Build and verify the installer + if: steps.scope.outputs.package == 'true' run: | & .\packaging\build.ps1 -PythonExe @(Get-Command python -CommandType Application)[0].Source -NodeExe @(Get-Command node -CommandType Application)[0].Source -CompilerExe $env:EE_CI_COMPILER -OutputRoot '.\outputs\candidate' - name: Verify the packaged simulator + if: steps.scope.outputs.package == 'true' run: | $browser = Join-Path ${env:ProgramFiles(x86)} 'Microsoft\Edge\Application\msedge.exe' node .\tools\smoke-workspace.mjs --root .\outputs\candidate\dist\EtherlightingEvolved --browser $browser --output .\outputs\candidate\packaged-smoke --port 4198 - name: Install, verify and uninstall the package + if: steps.scope.outputs.package == 'true' run: | $setup = @(Get-ChildItem -Path '.\outputs\candidate\dist' -Filter 'EtherlightingEvolved-Setup-*.exe') if ($setup.Count -ne 1) { throw 'Expected one installer.' } @@ -114,7 +152,7 @@ jobs: Start-Sleep -Seconds 1 } - name: Keep candidate diagnostics - if: always() + if: always() && steps.scope.outputs.package == 'true' uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7 with: name: package-checks-${{ github.sha }} diff --git a/docs/WORKFLOW.md b/docs/WORKFLOW.md index 7d1a676..4b0fdcd 100644 --- a/docs/WORKFLOW.md +++ b/docs/WORKFLOW.md @@ -44,6 +44,8 @@ The EE Quality workflow (`.github/workflows/quality.yml`) runs on every pull req The `Verify EE` job runs on Windows. It checks the commit authors and messages, installs the hash-pinned Python packages, restores the locked desktop packages and runs `tools/verify.ps1`. It then builds the installer with `packaging/build.ps1` and the Inno Setup release that `tools/ci-inno.ps1` downloads and checks, runs the packaged simulator in a browser, and installs, checks and uninstalls the package. A run started by hand on `main` keeps the verified installer as a workflow artifact for 90 days. +The job runs fewer steps when the changed files allow it. A pull request that changes only Markdown files and the images in `docs/screenshots/` gets the author and message check and `tools/check-repository.py`, without the tests or the installer. `docs/API.md` is an exception, because a test reads it. The installer steps are skipped when every changed file is a test, documentation, an issue or pull request template, or `.github/dependabot.yml`. A run started by hand runs every step. + The `Native client (macos-15)` and `Native client (ubuntu-24.04)` jobs build the desktop check program and run it against the simulator, package the client for x64 and arm64, check both archives, and open the packaged client against a local simulator. ## Toolchain