Skip to content

Component builds in GitHub Actions #5

Component builds in GitHub Actions

Component builds in GitHub Actions #5

name: Steeltoe.Configuration
on:
workflow_dispatch: {}
pull_request:
paths:
- .editorconfig
- stylecop.json
- '*.props'
- '*.ruleset'
- .config/dotnet-tools.json
- .github/workflows/component-shared-workflow.yml
- .github/workflows/component-configuration.yml
- src/Configuration/**
- src/Steeltoe.Configuration.slnf
jobs:
linux:
runs-on: ubuntu-latest
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
OS: ubuntu
SolutionFile: src/Steeltoe.Configuration.slnf
CommonTestArgs: >-
--no-build --configuration Release --blame-crash --blame-hang-timeout 3m
--collect "XPlat Code Coverage" --settings coverlet.runsettings --logger trx --results-directory ${{ github.workspace }}
services:
configServer:
image: steeltoe.azurecr.io/config-server
ports:
- 8888:8888
eurekaServer:
image: steeltoe.azurecr.io/eureka-server
ports:
- 8761:8761
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Setup .NET 9
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x
- name: Set package version
run: nbgv cloud
- name: Restore dependencies
run: dotnet restore ${{ env.SolutionFile }} --verbosity minimal --configfile nuget.config
- name: Build solution
run: dotnet build ${{ env.SolutionFile }} --no-restore -c Release -v minimal
- name: Test (net8.0)
run: dotnet test ${{ env.SolutionFile }} --framework net8.0 ${{ env.CommonTestArgs }}
continue-on-error: true
- name: Test (net9.0)
run: dotnet test ${{ env.SolutionFile }} --framework net9.0 ${{ env.CommonTestArgs }}
continue-on-error: true
- name: Upload hang dumps (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: FailedTestOutput-${{ env.OS }}
path: '**/*.dmp'
- name: Publish test results
if: always()
uses: actions/upload-artifact@v4
with:
name: TestResults-${{ env.OS }}
path: '**/*.trx'