Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 40 additions & 2 deletions .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,62 @@ 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 }
python -m pip install --no-deps --no-build-isolation -e .
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 }}
Expand All @@ -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.' }
Expand All @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions docs/WORKFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading