Skip to content

Commit 5606024

Browse files
committed
add concurrency settings, use shared workflow for config too
1 parent fe6d2fe commit 5606024

File tree

8 files changed

+61
-84
lines changed

8 files changed

+61
-84
lines changed

.github/workflows/component-common.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@ on:
1414
- src/Common/**
1515
- src/Steeltoe.Common.slnf
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
1721
jobs:
1822
linux:
1923
uses: ./.github/workflows/component-shared-workflow.yml
2024
with:
2125
component: Common
22-
os: ubuntu
26+
OS: ubuntu
2327

2428
windows:
2529
uses: ./.github/workflows/component-shared-workflow.yml
2630
with:
2731
component: Common
28-
os: windows
32+
OS: windows

.github/workflows/component-configuration.yml

Lines changed: 8 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -14,79 +14,14 @@ on:
1414
- src/Configuration/**
1515
- src/Steeltoe.Configuration.slnf
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
1721
jobs:
1822
linux:
19-
runs-on: ubuntu-latest
20-
21-
env:
22-
DOTNET_NOLOGO: true
23-
DOTNET_CLI_TELEMETRY_OPTOUT: 1
23+
uses: ./.github/workflows/component-shared-workflow.yml
24+
with:
25+
component: Configuration
2426
OS: ubuntu
25-
SolutionFile: src/Steeltoe.Configuration.slnf
26-
CommonTestArgs: >-
27-
--no-build --configuration Release --blame-crash --blame-hang-timeout 3m
28-
--collect "XPlat Code Coverage" --settings coverlet.runsettings --logger trx --results-directory ${{ github.workspace }}
29-
services:
30-
configServer:
31-
image: steeltoe.azurecr.io/config-server
32-
env:
33-
eureka.client.enabled: true
34-
eureka.client.serviceUrl.defaultZone: http://eurekaServer:8761/eureka
35-
eureka.instance.hostname: localhost
36-
eureka.instance.instanceId: localhost:configserver:8888
37-
ports:
38-
- 8888:8888
39-
40-
eurekaServer:
41-
image: steeltoe.azurecr.io/eureka-server
42-
ports:
43-
- 8761:8761
44-
steps:
45-
- name: Checkout repo
46-
uses: actions/checkout@v4
47-
with:
48-
fetch-depth: 0
49-
50-
- name: Setup .NET
51-
uses: actions/setup-dotnet@v4
52-
with:
53-
dotnet-version: |
54-
8.0.*
55-
9.0.*
56-
57-
- name: Set package version
58-
run: nbgv cloud
59-
60-
- name: Restore dependencies
61-
run: dotnet restore ${{ env.SolutionFile }} --verbosity minimal --configfile nuget.config
62-
63-
- name: Build solution
64-
run: dotnet build ${{ env.SolutionFile }} --no-restore --configuration Release --verbosity minimal
65-
66-
- name: Test (net8.0)
67-
run: dotnet test ${{ env.SolutionFile }} --framework net8.0 ${{ env.CommonTestArgs }}
68-
69-
- name: Test (net9.0)
70-
run: dotnet test ${{ env.SolutionFile }} --framework net9.0 ${{ env.CommonTestArgs }}
71-
72-
- name: Upload hang dumps (on failure)
73-
if: failure()
74-
uses: actions/upload-artifact@v4
75-
with:
76-
name: FailedTestOutput-${{ env.OS }}
77-
path: '**/*.dmp'
78-
79-
- name: Publish test results
80-
if: always()
81-
uses: actions/upload-artifact@v4
82-
with:
83-
name: TestResults-${{ env.OS }}
84-
path: '**/*.trx'
85-
86-
- name: Report test results
87-
uses: dorny/test-reporter@v2
88-
with:
89-
artifact: TestResults-${{ env.OS }}
90-
name: ${{ env.OS }} test results
91-
reporter: dotnet-trx
92-
path: '*.trx'
27+
runConfigServer: true

.github/workflows/component-connectors.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ on:
1414
- src/Connectors/**
1515
- src/Steeltoe.Connectors.slnf
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
1721
jobs:
1822
linux:
1923
uses: ./.github/workflows/component-shared-workflow.yml
2024
with:
2125
component: Connectors
22-
os: ubuntu
26+
OS: ubuntu

.github/workflows/component-discovery.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ on:
1414
- src/Discovery/**
1515
- src/Steeltoe.Discovery.slnf
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
1721
jobs:
1822
linux:
1923
uses: ./.github/workflows/component-shared-workflow.yml
2024
with:
2125
component: Discovery
22-
os: ubuntu
26+
OS: ubuntu

.github/workflows/component-logging.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ on:
1414
- src/Logging/**
1515
- src/Steeltoe.Logging.slnf
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
1721
jobs:
1822
linux:
1923
uses: ./.github/workflows/component-shared-workflow.yml
2024
with:
2125
component: Logging
22-
os: ubuntu
26+
OS: ubuntu

.github/workflows/component-management.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,26 @@ on:
1414
- src/Management/**
1515
- src/Steeltoe.Management.slnf
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
1721
jobs:
1822
linux:
1923
uses: ./.github/workflows/component-shared-workflow.yml
2024
with:
2125
component: Management
22-
os: ubuntu
26+
OS: ubuntu
2327

2428
macos:
2529
uses: ./.github/workflows/component-shared-workflow.yml
2630
with:
2731
component: Management
28-
os: macos
32+
OS: macos
2933
skipFilter: --filter "Category!=SkipOnMacOS"
3034

3135
windows:
3236
uses: ./.github/workflows/component-shared-workflow.yml
3337
with:
3438
component: Management
35-
os: windows
39+
OS: windows

.github/workflows/component-security.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,18 @@ on:
1414
- src/Security/**
1515
- src/Steeltoe.Security.slnf
1616

17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
1721
jobs:
1822
linux:
1923
uses: ./.github/workflows/component-shared-workflow.yml
2024
with:
2125
component: Security
22-
os: ubuntu
26+
OS: ubuntu
2327
windows:
2428
uses: ./.github/workflows/component-shared-workflow.yml
2529
with:
2630
component: Security
27-
os: windows
31+
OS: windows

.github/workflows/component-shared-workflow.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,30 @@ on:
1414
skipFilter:
1515
required: false
1616
type: string
17-
17+
runConfigServer:
18+
required: false
19+
type: boolean
20+
default: false
1821
jobs:
1922
build:
2023
name: Build ${{ inputs.component }} on ${{ inputs.OS }}
2124
runs-on: ${{ inputs.OS }}-latest
2225

26+
services:
27+
configserver:
28+
image: ${{ inputs.runConfigServer && 'steeltoe.azurecr.io/config-server' || null }}
29+
env:
30+
eureka.client.enabled: true
31+
eureka.client.serviceUrl.defaultZone: http://eurekaServer:8761/eureka
32+
eureka.instance.hostname: localhost
33+
eureka.instance.instanceId: localhost:configserver:8888
34+
ports:
35+
- 8888:8888
36+
eureka:
37+
image: ${{ inputs.runConfigServer && 'steeltoe.azurecr.io/eureka-server' || null }}
38+
ports:
39+
- 8888:8888
40+
2341
env:
2442
DOTNET_NOLOGO: true
2543
DOTNET_CLI_TELEMETRY_OPTOUT: 1

0 commit comments

Comments
 (0)