Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/component-common.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Steeltoe.Common

on:
workflow_dispatch: {}
pull_request:
paths:
- .editorconfig
- stylecop.json
- '*.props'
- '*.ruleset'
- .config/dotnet-tools.json
- .github/workflows/component-shared-workflow.yml
- .github/workflows/component-common.yml
- src/Common/**
- src/Steeltoe.Common.slnf

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linux:
uses: ./.github/workflows/component-shared-workflow.yml
with:
component: Common
OS: ubuntu

windows:
uses: ./.github/workflows/component-shared-workflow.yml
with:
component: Common
OS: windows
27 changes: 27 additions & 0 deletions .github/workflows/component-configuration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linux:
uses: ./.github/workflows/component-shared-workflow.yml
with:
component: Configuration
OS: ubuntu
runConfigServer: true
26 changes: 26 additions & 0 deletions .github/workflows/component-connectors.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Steeltoe.Connectors

on:
workflow_dispatch: {}
pull_request:
paths:
- .editorconfig
- stylecop.json
- '*.props'
- '*.ruleset'
- .config/dotnet-tools.json
- .github/workflows/component-shared-workflow.yml
- .github/workflows/component-connectors.yml
- src/Connectors/**
- src/Steeltoe.Connectors.slnf

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linux:
uses: ./.github/workflows/component-shared-workflow.yml
with:
component: Connectors
OS: ubuntu
26 changes: 26 additions & 0 deletions .github/workflows/component-discovery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Steeltoe.Discovery

on:
workflow_dispatch: {}
pull_request:
paths:
- .editorconfig
- stylecop.json
- '*.props'
- '*.ruleset'
- .config/dotnet-tools.json
- .github/workflows/component-shared-workflow.yml
- .github/workflows/component-discovery.yml
- src/Discovery/**
- src/Steeltoe.Discovery.slnf

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linux:
uses: ./.github/workflows/component-shared-workflow.yml
with:
component: Discovery
OS: ubuntu
26 changes: 26 additions & 0 deletions .github/workflows/component-logging.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Steeltoe.Logging

on:
workflow_dispatch: {}
pull_request:
paths:
- .editorconfig
- stylecop.json
- '*.props'
- '*.ruleset'
- .config/dotnet-tools.json
- .github/workflows/component-shared-workflow.yml
- .github/workflows/component-logging.yml
- src/Logging/**
- src/Steeltoe.Logging.slnf

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linux:
uses: ./.github/workflows/component-shared-workflow.yml
with:
component: Logging
OS: ubuntu
39 changes: 39 additions & 0 deletions .github/workflows/component-management.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Steeltoe.Management

on:
workflow_dispatch: {}
pull_request:
paths:
- .editorconfig
- stylecop.json
- '*.props'
- '*.ruleset'
- .config/dotnet-tools.json
- .github/workflows/component-shared-workflow.yml
- .github/workflows/component-management.yml
- src/Management/**
- src/Steeltoe.Management.slnf

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linux:
uses: ./.github/workflows/component-shared-workflow.yml
with:
component: Management
OS: ubuntu

macos:
uses: ./.github/workflows/component-shared-workflow.yml
with:
component: Management
OS: macos
skipFilter: Category!=SkipOnMacOS

windows:
uses: ./.github/workflows/component-shared-workflow.yml
with:
component: Management
OS: windows
31 changes: 31 additions & 0 deletions .github/workflows/component-security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Steeltoe.Security

on:
workflow_dispatch: {}
pull_request:
paths:
- .editorconfig
- stylecop.json
- '*.props'
- '*.ruleset'
- .config/dotnet-tools.json
- .github/workflows/component-shared-workflow.yml
- .github/workflows/component-security.yml
- src/Security/**
- src/Steeltoe.Security.slnf

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
linux:
uses: ./.github/workflows/component-shared-workflow.yml
with:
component: Security
OS: ubuntu
windows:
uses: ./.github/workflows/component-shared-workflow.yml
with:
component: Security
OS: windows
113 changes: 113 additions & 0 deletions .github/workflows/component-shared-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# .github/workflows/component-shared-workflow.yml

name: Component Build

on:
workflow_call:
inputs:
component:
required: true
type: string
OS:
required: true
type: string
skipFilter:
required: false
type: string
runConfigServer:
required: false
type: boolean
default: false

permissions:
contents: read
pull-requests: write

jobs:
build:
name: Build ${{ inputs.component }} on ${{ inputs.OS }}
runs-on: ${{ inputs.OS }}-latest

services:
eurekaServer:
image: ${{ inputs.runConfigServer && 'steeltoe.azurecr.io/eureka-server' || null }}
ports:
- 8761:8761
configServer:
image: ${{ inputs.runConfigServer && 'steeltoe.azurecr.io/config-server' || null }}
env:
eureka.client.enabled: true
eureka.client.serviceUrl.defaultZone: http://eurekaServer:8761/eureka
eureka.instance.hostname: localhost
eureka.instance.instanceId: localhost:configServer:8888
ports:
- 8888:8888

env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_GENERATE_ASPNET_CERTIFICATE: ${{ inputs.OS == 'macOS' && 'false' || '' }}
SolutionFile: src/Steeltoe.${{ inputs.component }}.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 }}
SkipFilterWithoutMemoryDumps: ${{ inputs.skipFilter && format('--filter "{0}&Category!=MemoryDumps"', inputs.skipFilter) || '--filter "Category!=MemoryDumps"' }}
SkipFilterWithMemoryDumps: ${{ inputs.skipFilter && format('--filter "{0}&Category=MemoryDumps"', inputs.skipFilter) || '--filter "Category=MemoryDumps"' }}

steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.*
9.0.*

- name: Install Nerdbank.GitVersioning (macOS only)
if: ${{ inputs.OS == 'macos' }}
run: dotnet tool install --global nbgv

- name: Set package version
run: nbgv cloud

- name: Restore dependencies
run: dotnet restore ${{ env.SolutionFile }} --verbosity minimal

- name: Build solution
run: dotnet build ${{ env.SolutionFile }} --no-restore --configuration Release --verbosity minimal

- name: Test (net8.0)
run: dotnet test ${{ env.SolutionFile }} --framework net8.0 ${{ env.SkipFilterWithoutMemoryDumps }} ${{ env.CommonTestArgs }}

- name: Test (net8.0) (memory dumps)
if: ${{ inputs.component == 'Management' }}
run: dotnet test ${{ env.SolutionFile }} --framework net8.0 ${{ env.SkipFilterWithMemoryDumps }} ${{ env.CommonTestArgs }}

- name: Test (net9.0)
run: dotnet test ${{ env.SolutionFile }} --framework net9.0 ${{ env.SkipFilterWithoutMemoryDumps }} ${{ env.CommonTestArgs }}

- name: dotnet test net9.0 (memory dumps)
if: ${{ inputs.component == 'Management' }}
run: dotnet test ${{ env.SolutionFile }} --framework net9.0 ${{ env.SkipFilterWithMemoryDumps }} ${{ env.CommonTestArgs }}

- name: Upload hang dumps (on failure)
if: failure()
uses: actions/upload-artifact@v4
with:
name: FailedTestOutput-${{ inputs.OS }}
path: '**/*.dmp'
if-no-files-found: ignore

- name: Report test results
if: always()
uses: dorny/test-reporter@v2
with:
name: ${{ inputs.OS }} test results
reporter: dotnet-trx
path: '**/*.trx'
fail-on-empty: 'true'
fail-on-error: 'false'