Skip to content

Commit 0545180

Browse files
committed
Add GHA workflows for component builds
1 parent 51f4b0c commit 0545180

8 files changed

Lines changed: 284 additions & 0 deletions
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Component Build - Common
2+
3+
on:
4+
workflow_dispatch: {}
5+
pull_request:
6+
paths:
7+
- .editorconfig
8+
- stylecop.json
9+
- '*.props'
10+
- '*.ruleset'
11+
- .config/dotnet-tools.json
12+
- .github/workflows/component-shared-workflow.yml
13+
- .github/workflows/component-common.yml
14+
- src/Common/**
15+
- src/Steeltoe.Common.slnf
16+
17+
jobs:
18+
build-linux:
19+
uses: ./component-shared-workflow.yml
20+
with:
21+
component: Common
22+
os: ubuntu
23+
24+
build-windows:
25+
uses: ./component-shared-workflow.yml
26+
with:
27+
component: Common
28+
os: windows
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Component Build - Configuration
2+
3+
on:
4+
workflow_dispatch: {}
5+
pull_request:
6+
paths:
7+
- .editorconfig
8+
- stylecop.json
9+
- '*.props'
10+
- '*.ruleset'
11+
- .config/dotnet-tools.json
12+
- .github/workflows/component-shared-workflow.yml
13+
- .github/workflows/component-configuration.yml
14+
- src/Configuration/**
15+
- src/Steeltoe.Configuration.slnf
16+
17+
jobs:
18+
build-linux:
19+
uses: ./component-shared-workflow.yml
20+
with:
21+
component: Configuration
22+
os: ubuntu
23+
runConfigServer: true
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Component Build - Connectors
2+
3+
on:
4+
workflow_dispatch: {}
5+
pull_request:
6+
paths:
7+
- .editorconfig
8+
- stylecop.json
9+
- '*.props'
10+
- '*.ruleset'
11+
- .config/dotnet-tools.json
12+
- .github/workflows/component-shared-workflow.yml
13+
- .github/workflows/component-connectors.yml
14+
- src/Connectors/**
15+
- src/Steeltoe.Connectors.slnf
16+
17+
jobs:
18+
build-linux:
19+
uses: ./component-shared-workflow.yml
20+
with:
21+
component: Connectors
22+
os: ubuntu
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Component Build - Discovery
2+
3+
on:
4+
workflow_dispatch: {}
5+
pull_request:
6+
paths:
7+
- .editorconfig
8+
- stylecop.json
9+
- '*.props'
10+
- '*.ruleset'
11+
- .config/dotnet-tools.json
12+
- .github/workflows/component-shared-workflow.yml
13+
- .github/workflows/component-Discovery.yml
14+
- src/Discovery/**
15+
- src/Steeltoe.Discovery.slnf
16+
17+
jobs:
18+
build-linux:
19+
uses: ./component-shared-workflow.yml
20+
with:
21+
component: Discovery
22+
os: ubuntu
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Component Build - Logging
2+
3+
on:
4+
workflow_dispatch: {}
5+
pull_request:
6+
paths:
7+
- .editorconfig
8+
- stylecop.json
9+
- '*.props'
10+
- '*.ruleset'
11+
- .config/dotnet-tools.json
12+
- .github/workflows/component-shared-workflow.yml
13+
- .github/workflows/component-Logging.yml
14+
- src/Logging/**
15+
- src/Steeltoe.Logging.slnf
16+
17+
jobs:
18+
build-linux:
19+
uses: ./component-shared-workflow.yml
20+
with:
21+
component: Logging
22+
os: ubuntu
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Component Build - Management
2+
3+
on:
4+
workflow_dispatch: {}
5+
pull_request:
6+
paths:
7+
- .editorconfig
8+
- stylecop.json
9+
- '*.props'
10+
- '*.ruleset'
11+
- .config/dotnet-tools.json
12+
- .github/workflows/component-shared-workflow.yml
13+
- .github/workflows/component-management.yml
14+
- src/Management/**
15+
- src/Steeltoe.Management.slnf
16+
17+
jobs:
18+
build-linux:
19+
uses: ./component-shared-workflow.yml
20+
with:
21+
component: Management
22+
os: ubuntu
23+
24+
build-macos:
25+
uses: ./component-shared-workflow.yml
26+
with:
27+
component: Management
28+
os: macos
29+
skipFilter: --filter "Category!=SkipOnMacOS"
30+
31+
build-windows:
32+
uses: ./component-shared-workflow.yml
33+
with:
34+
component: Management
35+
os: windows
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Component Build - Security
2+
3+
on:
4+
workflow_dispatch: {}
5+
pull_request:
6+
paths:
7+
- .editorconfig
8+
- stylecop.json
9+
- '*.props'
10+
- '*.ruleset'
11+
- .config/dotnet-tools.json
12+
- .github/workflows/component-shared-workflow.yml
13+
- .github/workflows/component-Security.yml
14+
- src/Security/**
15+
- src/Steeltoe.Security.slnf
16+
17+
jobs:
18+
build-linux:
19+
uses: ./component-shared-workflow.yml
20+
with:
21+
component: Security
22+
os: ubuntu
23+
build-windows:
24+
uses: ./component-shared-workflow.yml
25+
with:
26+
component: Security
27+
os: windows
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# .github/workflows/component-shared-workflow.yml
2+
3+
name: Component Build
4+
5+
on:
6+
workflow_call:
7+
inputs:
8+
component:
9+
required: true
10+
type: string
11+
os:
12+
required: true
13+
type: string
14+
skipFilter:
15+
required: false
16+
type: string
17+
runConfigServer:
18+
required: false
19+
type: boolean
20+
default: false
21+
22+
jobs:
23+
build:
24+
name: Build ${{ inputs.component }} on ${{ inputs.os }}
25+
runs-on: ${{ inputs.os }}-latest
26+
27+
services:
28+
configServer:
29+
if: ${{ inputs.runConfigServer }}
30+
image: steeltoe.azurecr.io/config-server
31+
ports:
32+
- 8888:8888
33+
env:
34+
eureka.client.enabled: true
35+
eureka.client.serviceUrl.defaultZone: http://eurekaServer:8761/eureka
36+
eureka.instance.hostname: localhost
37+
eureka.instance.instanceId: localhost:configserver:8888
38+
39+
eurekaServer:
40+
if: ${{ inputs.runConfigServer }}
41+
image: steeltoe.azurecr.io/eureka-server
42+
ports:
43+
- 8761:8761
44+
45+
env:
46+
DOTNET_NOLOGO: true
47+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
48+
DOTNET_GENERATE_ASPNET_CERTIFICATE: ${{ inputs.os == 'macos' && 'false' || '' }}
49+
SolutionFile: src/Steeltoe.${{ inputs.component }}.slnf
50+
CommonTestArgs: >-
51+
--blame-crash --blame-hang-timeout 3m --no-build
52+
-c Release --collect "XPlat Code Coverage"
53+
--settings coverlet.runsettings --logger trx
54+
--results-directory ${{ github.workspace }}
55+
56+
steps:
57+
- name: Checkout repo
58+
uses: actions/checkout@v4
59+
with:
60+
fetch-depth: 0
61+
62+
- name: Setup .NET 8
63+
uses: actions/setup-dotnet@v4
64+
with:
65+
dotnet-version: 8.0.x
66+
67+
- name: Setup .NET 9
68+
uses: actions/setup-dotnet@v4
69+
with:
70+
dotnet-version: 9.0.x
71+
72+
- name: Install Nerdbank.GitVersioning (macOS only)
73+
if: ${{ inputs.os == 'macos' }}
74+
run: dotnet tool install --global nbgv
75+
76+
- name: Set package version
77+
run: nbgv cloud
78+
79+
- name: Restore dependencies
80+
run: dotnet restore ${{ env.SolutionFile }} --verbosity minimal --configfile nuget.config
81+
82+
- name: Build solution
83+
run: dotnet build ${{ env.SolutionFile }} --no-restore -c Release -v minimal
84+
85+
- name: Test (net8.0)
86+
run: dotnet test ${{ env.SolutionFile }} --framework net8.0 ${{ inputs.skipFilter }} ${{ env.CommonTestArgs }}
87+
continue-on-error: true
88+
89+
- name: Test (net9.0)
90+
run: dotnet test ${{ env.SolutionFile }} --framework net9.0 ${{ inputs.skipFilter }} ${{ env.CommonTestArgs }}
91+
continue-on-error: true
92+
93+
- name: Upload hang dumps (on failure)
94+
if: failure()
95+
uses: actions/upload-artifact@v4
96+
with:
97+
name: FailedTestOutput-${{ inputs.os }}
98+
path: '**/*.dmp'
99+
100+
- name: Publish test results
101+
if: always()
102+
uses: actions/upload-artifact@v4
103+
with:
104+
name: TestResults-${{ inputs.os }}
105+
path: '**/*.trx'

0 commit comments

Comments
 (0)