GitHub Actions RHEL 9 and 10 Runners: Build and Test ASP.NET Core
GitHub Actions now offers generally available RHEL 9 and RHEL 10 images for Linux x64 larger runners. Teams on GitHub Team or GitHub Enterprise Cloud can configure a runner using a partner image and test their .NET application on the Linux family they deploy to. The announcement is dated November 19, 2026.
News brief: November 20, 2026, India time. The workflow below is an untested example; no GitHub-hosted RHEL job was executed for this article.
| Previously | November 19 update |
|---|---|
| RHEL images were in public preview from June 2026. | RHEL 9 and 10 images are generally available. |
| Preview users had existing configured runners. | GitHub says existing runners and workflows continue without changes. |
| A different Linux image could miss distribution-specific problems. | Teams can choose the matching RHEL family for CI. |
See the official announcement. This is a larger-runner offering: do not assume a public label such as rhel-latest exists.
When does a RHEL CI job help?
Imagine Orders.Api passes tests on a developer laptop but loads a native library only in production. A RHEL test lane gives you a place to check that dependency before deployment. It does not recreate your production network, configuration, SELinux settings or database by itself. Record those differences in the test plan.
Configure the image and repository access
- As an organization owner, open organization Settings → Actions → Runners.
- Create a GitHub-hosted larger runner. Select Linux x64 and open the Partner image choices.
- Select RHEL 9 or RHEL 10 to match the intended deployment, then choose capacity and concurrency.
- Use a runner group to grant the Orders.Api repository access. Record the configured runner name/label for the workflow.
Follow Managing larger runners for setup and access controls, and Running jobs on larger runners for targeting syntax. Review billing before introducing a permanent additional lane.
Build a small solution before testing your real API
The following scaffold produces an API and a test project. Use your existing solution paths for a real repository. These commands and the workflow are illustrative, not a claim of an executed proof of concept.
dotnet new sln --format sln -n Orders
dotnet new webapi -n Orders.Api -o src/Orders.Api -f net10.0
dotnet new xunit -n Orders.Tests -o tests/Orders.Tests -f net10.0
dotnet sln Orders.sln add src/Orders.Api/Orders.Api.csproj
dotnet sln Orders.sln add tests/Orders.Tests/Orders.Tests.csproj
dotnet add tests/Orders.Tests/Orders.Tests.csproj reference src/Orders.Api/Orders.Api.csprojThe generated sample test checks that the test runner works. Add application tests that exercise the native dependency you actually need before calling this a compatibility gate.
name: Orders API on RHEL
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
# Replace with the exact name/label of your configured larger runner.
runs-on: REPLACE_WITH_ORG_RHEL_RUNNER_LABEL
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- name: Verify operating system and architecture
run: |
cat /etc/os-release
uname -m
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Verify SDK
run: dotnet --info
- run: dotnet restore Orders.sln
- run: dotnet build Orders.sln -c Release --no-restore
- name: Run tests
run: dotnet test Orders.sln -c Release --no-build --logger "trx;LogFileName=rhel-tests.trx" --results-directory TestResults
The action major versions shown are examples, not a claim that they are the newest available. Review the official checkout and setup-dotnet repositories, your action policy, and immutable commit pinning before production use.
What should you verify in the first run?
| Evidence | Expected check |
|---|---|
| /etc/os-release | The selected RHEL major version, not another Linux distribution. |
| uname -m | x86_64 for this Linux x64 runner choice. |
| dotnet --info | The required SDK is present and the runtime identifier is appropriate. |
| Build and TRX output | The correct projects build and the intended tests execute. |
| Native dependency test | The library can load and perform a representative operation. |
Inspect the job logs and the generated TestResults directory. This example does not upload the TRX files as an artifact; add an approved artifact step if you need downloaded results after the job ends. An empty test suite is not evidence of production compatibility.
Troubleshooting without changing multiple variables
If a job stays queued, inspect the exact runner target and runner-group access before editing .NET code. If restore fails, check package-source connectivity and authentication. If a native dependency fails, read the missing library name, compare installed packages and add a documented package-install step or approved custom image. Never install an arbitrary list of native packages just to hide a failing test.
Frequently asked questions
Do preview users need to recreate their runners?
GitHub says no action is needed for existing preview runners and workflows.
Can I test both RHEL versions?
Yes: configure one runner for each image and use two jobs or a matrix of their actual configured labels. The versions are alternative runner environments, not sequential installations in one job.
Does a green unit-test run prove the application will work on production RHEL?
It proves only the tests executed under that environment. Add deployment, integration and native-dependency checks that represent your application.
Comments
Post a Comment