test: tier verification and add WebView2 smoke

This commit is contained in:
Nwflower committed 2026-12-01 08:04:06 -07:00
1 parent 9d1770f903
commit eb65b7cd41
25 files changed
+753 -252

No files matched your search

+57 -19
View File
@@ -6,12 +6,38 @@ on:
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GOCACHE: ${{ github.workspace }}/.debug/cache/go-build
jobs:
verify:
runs-on: windows-latest
outputs:
rolling: ${{ steps.rolling.outputs.publish }}
steps:
- uses: actions/checkout@v4
- name: Check whether this push affects the rolling release
id: rolling
if: github.event_name == 'push'
env:
PREVIOUS_SHA: ${{ github.event.before }}
shell: pwsh
run: |
$publish = $true
if ($env:PREVIOUS_SHA -notmatch '^0+$') {
git fetch --depth=1 origin $env:PREVIOUS_SHA
if ($LASTEXITCODE -ne 0) { throw 'Could not fetch the previous main commit' }
$changed = git diff --name-only $env:PREVIOUS_SHA HEAD -- . ':(exclude)docs/**' ':(exclude)README.md' ':(exclude)README.en.md' ':(exclude)AGENTS.md' ':(exclude).github/ISSUE_TEMPLATE/**' ':(exclude).github/readme/**'
if ($LASTEXITCODE -ne 0) { throw 'Could not compare the pushed commits' }
$publish = [bool]$changed
}
"publish=$($publish.ToString().ToLowerInvariant())" >> $env:GITHUB_OUTPUT
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
@@ -35,34 +61,46 @@ jobs:
throw 'Could not parse Version from internal/version/version.go'
}
$ver = $Matches[1]
$tmp = Join-Path $env:RUNNER_TEMP "release-notes-$ver.md"
New-Item -ItemType Directory -Force -Path .debug/runs/ci | Out-Null
$tmp = Join-Path $PWD ".debug/runs/ci/release-notes-$ver.md"
& ./scripts/build-release-notes.ps1 -Tag $ver -OutFile $tmp
"REIMS_APP_VERSION=$ver" >> $env:GITHUB_ENV
Write-Host "PASS CHANGELOG.md contains valid release notes for $ver ($((Get-Item -LiteralPath $tmp).Length) bytes)"
- name: Frontend test & build
- name: Workspace hygiene
shell: pwsh
run: |
pnpm --dir frontend install --frozen-lockfile
pnpm --dir frontend test
pnpm --dir frontend build
run: node scripts/debug/check.mjs
- name: Debug workspace hygiene check & self-test
- name: Install frontend dependencies
shell: pwsh
run: |
node scripts/debug/check.mjs
node --test scripts/debug/debug.test.mjs
run: pnpm --dir frontend install --frozen-lockfile
- name: Go test & vet
- name: CI tests
shell: pwsh
run: |
go test ./...
go vet ./...
run: node scripts/test.mjs ci
- name: Bundle frontend
shell: pwsh
run: pnpm --dir frontend bundle
- name: Build reims-go.exe (window + command-line mode)
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path build/bin | Out-Null
go build -trimpath -tags desktop,production -ldflags "-H windowsgui" -o build/bin/reims-go.exe .
# Command-line mode must still answer through a pipe from the GUI-subsystem build.
$out = & build/bin/reims-go.exe version | Out-String
if ($LASTEXITCODE -ne 0 -or $out -notmatch '^reims-go ') { throw "reims-go.exe version failed: $out" }
$env:GOTMPDIR = (Resolve-Path .debug/runs/ci).Path
$exe = '.debug/runs/ci/reims-go.exe'
go vet -tags desktop,production .
if ($LASTEXITCODE -ne 0) { throw 'Go desktop vet failed' }
go build -trimpath -tags desktop,production -ldflags "-H windowsgui" -o $exe .
if ($LASTEXITCODE -ne 0) { throw 'Go desktop build failed' }
./scripts/check-release-artifact.ps1 -Executable $exe -Version $env:REIMS_APP_VERSION
- name: WebView2 first-launch smoke
timeout-minutes: 3
run: node scripts/test.mjs webview2 .debug/runs/ci/reims-go.exe
rolling-release:
needs: verify
if: needs.verify.outputs.rolling == 'true'
permissions:
contents: write
uses: ./.github/workflows/dev-release.yml
+24 -19
View File
@@ -1,16 +1,7 @@
name: Dev Release (Rolling)
on:
push:
branches:
- main
paths-ignore:
- "docs/**"
- "README.md"
- "README.en.md"
- "AGENTS.md"
- ".github/ISSUE_TEMPLATE/**"
- ".github/readme/**"
workflow_call:
workflow_dispatch:
permissions:
@@ -20,6 +11,9 @@ concurrency:
group: dev-release-${{ github.ref }}
cancel-in-progress: true
env:
GOCACHE: ${{ github.workspace }}/.debug/cache/go-build
jobs:
dev-release:
runs-on: windows-latest
@@ -127,7 +121,8 @@ jobs:
} catch {
Write-Warning "Could not query latest stable runtime release: $_"
}
$notesFile = Join-Path $env:RUNNER_TEMP "release-notes-dev.md"
New-Item -ItemType Directory -Force -Path .debug/runs/dev-release | Out-Null
$notesFile = Join-Path $PWD '.debug/runs/dev-release/release-notes-dev.md'
& ./scripts/build-release-notes.ps1 `
-Tag $devVersion `
-Channel dev `
@@ -140,17 +135,18 @@ jobs:
"RELEASE_NOTES_FILE=$notesFile" | Out-File -FilePath $env:GITHUB_ENV -Append
Write-Host "Generated dev release notes ($((Get-Item -LiteralPath $notesFile).Length) bytes) for $devVersion"
- name: Build frontend
- name: Install frontend dependencies
shell: pwsh
run: |
pnpm --dir frontend install --frozen-lockfile
pnpm --dir frontend build
run: pnpm --dir frontend install --frozen-lockfile
- name: Go test & vet
- name: CI tests for manual builds
if: github.event_name == 'workflow_dispatch'
shell: pwsh
run: |
go test ./...
go vet ./...
run: node scripts/test.mjs ci
- name: Bundle frontend
shell: pwsh
run: pnpm --dir frontend bundle
- name: Install Wails CLI
shell: pwsh
@@ -177,6 +173,15 @@ jobs:
[IO.File]::WriteAllText((Join-Path $dist 'SHA256SUMS.txt'), ($lines -join "`n") + "`n", [Text.UTF8Encoding]::new($false))
Get-Content (Join-Path $dist 'SHA256SUMS.txt')
- name: Verify release artifacts
shell: pwsh
run: ./scripts/check-release-artifact.ps1 -Executable "dist-release/reims-go-$env:DEV_VERSION-windows-amd64.exe" -Version $env:DEV_VERSION -Package
- name: WebView2 first-launch smoke for manual builds
if: github.event_name == 'workflow_dispatch'
timeout-minutes: 3
run: node scripts/test.mjs webview2 "dist-release/reims-go-$env:DEV_VERSION-windows-amd64.exe"
- name: Update rolling dev GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+21 -9
View File
@@ -13,6 +13,9 @@ on:
permissions:
contents: write
env:
GOCACHE: ${{ github.workspace }}/.debug/cache/go-build
jobs:
release:
runs-on: windows-latest
@@ -76,7 +79,8 @@ jobs:
} catch {
Write-Warning "Could not query latest stable runtime release: $_"
}
$notesFile = Join-Path $env:RUNNER_TEMP "release-notes-$tag.md"
New-Item -ItemType Directory -Force -Path .debug/runs/release | Out-Null
$notesFile = Join-Path $PWD ".debug/runs/release/release-notes-$tag.md"
& ./scripts/build-release-notes.ps1 `
-Tag $tag `
-Channel $channel `
@@ -88,17 +92,17 @@ jobs:
"RELEASE_NOTES_FILE=$notesFile" | Out-File -FilePath $env:GITHUB_ENV -Append
Write-Host "Generated $channel release notes ($((Get-Item -LiteralPath $notesFile).Length) bytes) for $tag"
- name: Build frontend
- name: Install frontend dependencies
shell: pwsh
run: |
pnpm --dir frontend install --frozen-lockfile
pnpm --dir frontend build
run: pnpm --dir frontend install --frozen-lockfile
- name: Go test & vet
- name: Release tests
shell: pwsh
run: |
go test ./...
go vet ./...
run: node scripts/test.mjs release
- name: Bundle frontend
shell: pwsh
run: pnpm --dir frontend bundle
- name: Install Wails CLI
shell: pwsh
@@ -126,6 +130,14 @@ jobs:
[IO.File]::WriteAllText((Join-Path $dist 'SHA256SUMS.txt'), ($lines -join "`n") + "`n", [Text.UTF8Encoding]::new($false))
Get-Content (Join-Path $dist 'SHA256SUMS.txt')
- name: Verify release artifacts
shell: pwsh
run: ./scripts/check-release-artifact.ps1 -Executable "dist-release/reims-go-$env:RELEASE_TAG-windows-amd64.exe" -Version $env:RELEASE_TAG -Package
- name: WebView2 first-launch smoke
timeout-minutes: 3
run: node scripts/test.mjs webview2 "dist-release/reims-go-$env:RELEASE_TAG-windows-amd64.exe"
- name: Publish GitHub Release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}