-
Notifications
You must be signed in to change notification settings - Fork 171
Component builds in GitHub Actions #1518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
60b59a4
Add GHA workflows for component builds
TimHess 07938a7
cleaner names, add configuration (w/o using template)
TimHess d89cb0e
Update .github/workflows/component-shared-workflow.yml
TimHess 2bef5ec
remove continue-on-error: true, add missing eureka vars
TimHess 46d388e
report test results
TimHess 1cb4d91
fix configuration workflow
TimHess 336c0fa
add concurrency settings, use shared workflow for config too
TimHess dc6c4fa
fix port copy-pasta, test cancel-in-progress
TimHess cd0a273
always try to report tests
TimHess 5bdc218
start eureka before config server
TimHess 7ec56b6
pause for 30 seconds when config server runs
TimHess 9922d5d
container names
TimHess b7b68e0
remove the 30 second pause for discovery-first
TimHess 7ca6321
Update .github/workflows/component-shared-workflow.yml
TimHess 636b18c
don't warn when no hang dumps, try skipping upload of .trx files
TimHess 91bb3de
Test reporter: fail on empy test results, don't add a secondary failu…
TimHess 4fed6d5
reduce workflow permissions
TimHess 61ffc0d
adjust for memory dump test separation
TimHess 64cb651
Apply suggestions from code review
TimHess File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: | ||
bart-vmware marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| name: FailedTestOutput-${{ inputs.OS }} | ||
| path: '**/*.dmp' | ||
| if-no-files-found: ignore | ||
|
|
||
| - name: Report test results | ||
| if: always() | ||
bart-vmware marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| uses: dorny/test-reporter@v2 | ||
bart-vmware marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| with: | ||
| name: ${{ inputs.OS }} test results | ||
| reporter: dotnet-trx | ||
| path: '**/*.trx' | ||
| fail-on-empty: 'true' | ||
| fail-on-error: 'false' | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.