.github/.github/workflows/ci-dotnet.yaml
Adam Moussa e753ea0767
Some checks are pending
ci / isolation-tests (push) Waiting to run
ci / actionlint (push) Waiting to run
ci / ci-complete (push) Blocked by required conditions
Release on reusable change / version (push) Waiting to run
Release on reusable change / release (push) Blocked by required conditions
ci(workflows): prefer seahaven-ubuntu when the runner pool is up (#166)
2026-10-06 17:50:42 -04:00

52 lines
1.5 KiB
YAML

name: CI — .NET
on:
workflow_call:
inputs:
dotnet-version:
description: ".NET SDK version"
type: string
default: "8.0.x"
working-directory:
description: "Directory containing the solution/project"
type: string
default: "."
solution:
description: "Solution or project file to build"
type: string
default: "*.sln"
run-tests:
description: "Run dotnet test"
type: boolean
default: true
permissions:
contents: read
jobs:
ci:
# Org variable RUNNER_UBUNTU. seahaven-ubuntu when the pool can start a job, otherwise ubuntu-latest.
runs-on: "${{ vars.RUNNER_UBUNTU == 'seahaven-ubuntu' && 'seahaven-ubuntu' || 'ubuntu-latest' }}"
timeout-minutes: 20
concurrency:
group: ci-dotnet-${{ github.workflow }}-${{ github.ref }}-${{ inputs.working-directory }}
cancel-in-progress: true
defaults:
run:
working-directory: ${{ inputs.working-directory }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6.0.0
with:
dotnet-version: ${{ inputs.dotnet-version }}
- name: Restore
run: dotnet restore ${{ inputs.solution }}
- name: Build
run: dotnet build ${{ inputs.solution }} --no-restore --configuration Release
- name: Test
if: ${{ inputs.run-tests }}
run: dotnet test ${{ inputs.solution }} --no-build --configuration Release