Skip to content

Bump the github-actions group across 1 directory with 3 updates #376

Bump the github-actions group across 1 directory with 3 updates

Bump the github-actions group across 1 directory with 3 updates #376

Workflow file for this run

name: CI
# Builds the .NET 10 Control Panel (hMailCP) and the .NET tools solution on
# every push / PR, and verifies the committed generated code still matches its
# sources. This catches C# regressions cheaply. The tools build against
# the checked-in COM interop wrapper (source/Tools/Interop), so no registered
# typelib is needed. The C++ server build + the 1049-test regression suite need
# the prebuilt native libraries (OpenSSL 4.0.x, Boost 1.91, PostgreSQL 18 libpq —
# see libraries/build-dependencies.ps1) and a database service, so they run in the
# separate, manually-triggered server-build workflow.
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
permissions:
contents: read
jobs:
control-panel:
name: Build Control Panel (.NET 10)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
# The Ctrl+K palette's settings index is generated code that is committed
# so it stays reviewable in diffs. Nothing regenerates it at build time,
# so verify it here instead: re-run the generator and fail if the working
# tree moves. This needs neither the SDK nor a build, so it runs first and
# costs a few seconds. The generator pins its own read and write encodings,
# so it produces the same bytes here as on a maintainer's machine, and
# .gitattributes (* text=auto eol=crlf) keeps line endings out of it.
- name: Regenerate the settings search index
shell: pwsh
run: ./build/generate-settings-index.ps1
- name: Verify the committed settings index is up to date
shell: pwsh
run: |
$index = 'hmailserver/source/Tools/ControlPanel/Services/SettingsSearchIndex.g.cs'
if (git status --porcelain -- $index)
{
git --no-pager diff -- $index
Write-Host "::error file=$index::Out of date. Run ./build/generate-settings-index.ps1 and commit the result."
exit 1
}
Write-Host "$index matches the settings page definitions."
- name: Set up .NET 10
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: '10.0.x'
- name: Restore
run: dotnet restore hmailserver/source/Tools/ControlPanel/ControlPanel.csproj
- name: Build (Release, warnings as errors)
run: dotnet build hmailserver/source/Tools/ControlPanel/ControlPanel.csproj -c Release --no-restore -warnaserror
- name: Publish (smoke check)
run: dotnet publish hmailserver/source/Tools/ControlPanel/ControlPanel.csproj -c Release -o publish --no-build
- name: Restore tests
shell: bash
run: dotnet restore hmailserver/source/Tools/ControlPanel.Tests/ControlPanel.Tests.csproj
- name: Test with coverage
shell: bash
run: >
dotnet test hmailserver/source/Tools/ControlPanel.Tests/ControlPanel.Tests.csproj
--configuration Release
--collect:"XPlat Code Coverage"
--results-directory coverage
--
DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=cobertura
- name: Locate coverage report
shell: pwsh
run: |
$f = Get-ChildItem -Path coverage -Recurse -Filter "*.xml" | Select-Object -First 1
Copy-Item $f.FullName coverage\coverage.cobertura.xml
- name: Upload coverage artifact
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: coverage-report-csharp
path: coverage/coverage.cobertura.xml
tools:
name: Build .NET tools
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up .NET 10
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: '10.0.x'
- name: Build tools solution (Release)
run: dotnet build "hmailserver/source/Tools/hMailServer Tools.sln" -c Release -warnaserror
- name: Publish smoke check
shell: pwsh
run: ./build/build-tools.ps1
upload-coverage-csharp:
needs: control-panel
if: ${{ !cancelled() && needs.control-panel.result == 'success' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}
runs-on: ubuntu-latest
permissions:
contents: read
code-quality: write
steps:
- name: Download coverage artifact
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: coverage-report-csharp
- uses: actions/upload-code-coverage@d8e329117199404bba6fc81efe8093dc7c015e34 # v1.4.2
with:
file: coverage.cobertura.xml
language: C#
label: code-coverage-agent
# The upload needs the "Code quality" repository setting, and
# returns 403 without it. Tested on 22 Aug 2026: with the setting
# configured and NO languages the upload succeeds - but merely having
# the setting on re-exposes the 1,482 stale findings of the managed
# quality scan that was switched off on purpose (it ignored this
# repository's analysis configuration). That page being clean is
# worth more than this upload, so the setting stays off and the
# cobertura report kept as a build artifact is the coverage record.
# A failed upload is therefore a warning, not a failed pipeline.
fail-on-error: false