-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace actions from
flobernd/actions
with zyactions
- Loading branch information
Showing
4 changed files
with
71 additions
and
60 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -2,12 +2,21 @@ name: CD | |
|
||
on: | ||
workflow_call: | ||
inputs: | ||
path: | ||
description: The path where to look for a Visual Studio Solution file (without a trailing slash). | ||
type: string | ||
required: false | ||
default: '' | ||
secrets: | ||
NUGET_API_KEY: | ||
required: true | ||
|
||
env: | ||
BUILD_CONFIG: Release | ||
DOTNET_GLOBAL_JSON: ${{ inputs.path != '' && format('{0}/global.json', inputs.path) || 'global.json' }} | ||
RESTORE_PATTERN: ${{ inputs.path != '' && format('{0}/**/packages.lock.json', inputs.path) || '**/packages.lock.json' }} | ||
ARTIFACTS_PATH: ${{ inputs.path != '' && format('{0}/nupkg', inputs.path) || 'nupkg' }} | ||
|
||
jobs: | ||
release: | ||
|
@@ -21,15 +30,16 @@ jobs: | |
fetch-depth: 0 | ||
|
||
- name: .NET Setup | ||
uses: flobernd/actions/dotnet/setup@master | ||
uses: zyactions/dotnet-setup@v1.0.0 | ||
with: | ||
# Use version defined in 'global.json' | ||
dotnet-version: '' | ||
disable-problem-matcher: true | ||
global-json-file: ${{ env.DOTNET_GLOBAL_JSON }} | ||
problem-matcher: false | ||
|
||
- name: Detect Version | ||
uses: dotnet/nbgv@master | ||
id: nbgv | ||
uses: dotnet/nbgv@master | ||
with: | ||
path: ${{ inputs.path }} | ||
|
||
- name: Create Release | ||
uses: flobernd/actions/github/create-release@master | ||
|
@@ -41,6 +51,8 @@ jobs: | |
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
env: | ||
FILTERED_SOLUTION: ${{ inputs.path != '' && format('{0}/Packages.slnf', inputs.path) || 'Packages.slnf' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
@@ -51,42 +63,45 @@ jobs: | |
- name: Find Solution | ||
id: find | ||
uses: flobernd/actions/dotnet/find-solution@master | ||
with: | ||
directory: ${{ inputs.path }} | ||
|
||
- uses: flobernd/actions/dotnet/filter-solution@master | ||
name: Filter Solution | ||
with: | ||
solution: ${{ steps.find.outputs.solution }} | ||
# This pattern is relative to the solution file and does not need to be prefixed with | ||
# the 'directory' input value | ||
pattern: | | ||
**/*.csproj | ||
!**/*.Test*.csproj | ||
!**/*.Examples*.csproj | ||
output: ./Packages.slnf | ||
output: ${{ env.FILTERED_SOLUTION }} | ||
|
||
- name: .NET Setup | ||
uses: flobernd/actions/dotnet/setup@master | ||
uses: zyactions/dotnet-setup@v1.0.0 | ||
with: | ||
# Use version defined in 'global.json' | ||
dotnet-version: '' | ||
disable-problem-matcher: false | ||
global-json-file: ${{ env.DOTNET_GLOBAL_JSON }} | ||
problem-matcher: true | ||
|
||
- name: .NET Restore | ||
uses: flobernd/actions/dotnet/restore@master | ||
with: | ||
workspace: ./Packages.slnf | ||
cache-key: ${{ hashFiles('**/packages.lock.json') }} | ||
workspace: ${{ env.FILTERED_SOLUTION }} | ||
cache-key: ${{ hashFiles(env.RESTORE_PATTERN) }} | ||
|
||
- name: .NET Pack | ||
uses: flobernd/actions/dotnet/pack@master | ||
with: | ||
workspace: ./Packages.slnf | ||
workspace: ${{ env.FILTERED_SOLUTION }} | ||
configuration: ${{ env.BUILD_CONFIG }} | ||
output: ./nupkg | ||
output: ${{ env.ARTIFACTS_PATH }} | ||
|
||
- name: Upload Artifact | ||
uses: actions/[email protected] | ||
with: | ||
name: packages | ||
path: ./nupkg | ||
path: ${{ env.ARTIFACTS_PATH }} | ||
|
||
publish: | ||
name: Publish to ${{ matrix.feed.name }} | ||
|
@@ -100,21 +115,20 @@ jobs: | |
needs: build | ||
steps: | ||
- name: .NET Setup | ||
uses: flobernd/actions/dotnet/setup@master | ||
uses: zyactions/dotnet-setup@v1.0.0 | ||
with: | ||
# Use version defined in 'global.json' | ||
dotnet-version: '' | ||
disable-problem-matcher: true | ||
global-json-file: ${{ env.DOTNET_GLOBAL_JSON }} | ||
problem-matcher: false | ||
|
||
- name: Download Packages | ||
uses: actions/[email protected] | ||
with: | ||
name: packages | ||
path: ./nupkg | ||
path: ${{ env.ARTIFACTS_PATH }} | ||
|
||
- name: .NET NuGet Push | ||
uses: flobernd/actions/dotnet/nuget-push@master | ||
with: | ||
packages: ./nupkg/*.nupkg | ||
packages: ${{ format('{0}/*.nupkg', env.ARTIFACTS_PATH) }} | ||
nuget-source: ${{ matrix.feed.source }} | ||
nuget-api-key: ${{ secrets[matrix.feed.key] }} |
This file contains 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 |
---|---|---|
|
@@ -3,10 +3,8 @@ name: CI | |
on: | ||
workflow_call: | ||
inputs: | ||
directory: | ||
description: > | ||
The directory in which a Visual Studio Solution file is to be searched for. | ||
Do not add a trailing slash. | ||
path: | ||
description: The path where to look for a Visual Studio Solution file (without a trailing slash). | ||
type: string | ||
required: false | ||
default: '' | ||
|
@@ -16,6 +14,9 @@ on: | |
|
||
env: | ||
BUILD_CONFIG: Debug | ||
DOTNET_GLOBAL_JSON: ${{ inputs.path != '' && format('{0}/global.json', inputs.path) || 'global.json' }} | ||
RESTORE_PATTERN: ${{ inputs.path != '' && format('{0}/**/packages.lock.json', inputs.path) || '**/packages.lock.json' }} | ||
TESTS_PATTERN: ${{ inputs.path != '' && format('{0}/**/*.Test*.csproj', inputs.path) || '**/*.Test*.csproj' }} | ||
|
||
jobs: | ||
lint: | ||
|
@@ -31,26 +32,26 @@ jobs: | |
- name: Get Changed Files | ||
id: changed-files | ||
uses: tj-actions/changed-files@932dad31974f07bd23cab5870d45c6e5ad5c8b73 | ||
# TODO: This step should honor the directory input | ||
with: | ||
files: ${{ inputs.path != '' && format('{0}/**', inputs.path) || '' }} | ||
|
||
- name: Find Solution | ||
id: find | ||
uses: flobernd/actions/dotnet/find-solution@master | ||
with: | ||
directory: ${{ inputs.directory }} | ||
directory: ${{ inputs.path }} | ||
|
||
- name: .NET Setup | ||
uses: flobernd/actions/dotnet/setup@master | ||
uses: zyactions/dotnet-setup@v1.0.0 | ||
with: | ||
# Use version defined in 'global.json' | ||
dotnet-version: '' | ||
disable-problem-matcher: true | ||
global-json-file: ${{ env.DOTNET_GLOBAL_JSON }} | ||
problem-matcher: false | ||
|
||
- name: .NET Restore | ||
uses: flobernd/actions/dotnet/restore@master | ||
with: | ||
workspace: ${{ steps.find.outputs.solution }} | ||
cache-key: ${{ hashFiles('**/packages.lock.json') }} | ||
cache-key: ${{ hashFiles(env.RESTORE_PATTERN) }} | ||
|
||
# TODO: Add additional generic '.editorconfig' linting, e.g. for `*.csproj` files | ||
|
||
|
@@ -64,6 +65,8 @@ jobs: | |
test: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
env: | ||
FILTERED_SOLUTION: ${{ inputs.path != '' && format('{0}/Tests.slnf', inputs.path) || 'Tests.slnf' }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
|
@@ -75,52 +78,49 @@ jobs: | |
id: find | ||
uses: flobernd/actions/dotnet/find-solution@master | ||
with: | ||
directory: ${{ inputs.directory }} | ||
directory: ${{ inputs.path }} | ||
|
||
- name: Filter Solution | ||
uses: flobernd/actions/dotnet/filter-solution@master | ||
with: | ||
solution: ${{ steps.find.outputs.solution }} | ||
pattern: | | ||
**/*.Test*.csproj | ||
output: ./Tests.slnf | ||
# TODO: This step should honor the directory input for outputting the Solution Filter | ||
# This pattern is relative to the solution file and does not need to be prefixed with | ||
# the 'directory' input value | ||
pattern: '**/*.Test*.csproj' | ||
output: ${{ env.FILTERED_SOLUTION }} | ||
|
||
- name: .NET Setup | ||
uses: flobernd/actions/dotnet/setup@master | ||
uses: zyactions/dotnet-setup@v1.0.0 | ||
with: | ||
# Use version defined in 'global.json' | ||
dotnet-version: '' | ||
disable-problem-matcher: true | ||
global-json-file: ${{ env.DOTNET_GLOBAL_JSON }} | ||
problem-matcher: false | ||
|
||
- name: .NET Restore | ||
uses: flobernd/actions/dotnet/restore@master | ||
with: | ||
workspace: ./Tests.slnf | ||
cache-key: ${{ hashFiles('**/packages.lock.json') }} | ||
# TODO: This step should honor the directory input for hashing | ||
workspace: ${{ env.FILTERED_SOLUTION }} | ||
cache-key: ${{ hashFiles(env.RESTORE_PATTERN) }} | ||
|
||
- name: .NET Build | ||
uses: flobernd/actions/dotnet/build@master | ||
with: | ||
workspace: ./Tests.slnf | ||
workspace: ${{ env.FILTERED_SOLUTION }} | ||
configuration: ${{ env.BUILD_CONFIG }} | ||
|
||
- name: .NET Test | ||
uses: flobernd/actions/dotnet/test@master | ||
with: | ||
projects: '**/*.Test*.csproj' | ||
projects: ${{ env.TESTS_PATTERN }} | ||
fail-on-error: false | ||
log-results: true | ||
collect-coverage: false | ||
maxdop: 4 | ||
# TODO: This step should honor the directory input for test discovery | ||
|
||
- name: Generate Test Report | ||
uses: zyactions/test-reporter@main | ||
with: | ||
name: Test Results | ||
path: '**/TestResults/*.trx' | ||
path: ${{ inputs.path != '' && format('{0}/**/TestResults/*.trx', inputs.path) || '**/TestResults/*.trx' }} | ||
reporter: dotnet-trx | ||
fail-on-error: true | ||
only-summary: false | ||
|
@@ -140,21 +140,19 @@ jobs: | |
id: find | ||
uses: flobernd/actions/dotnet/find-solution@master | ||
with: | ||
directory: ${{ inputs.directory }} | ||
directory: ${{ inputs.path }} | ||
|
||
- name: .NET Setup | ||
uses: flobernd/actions/dotnet/setup@master | ||
uses: zyactions/dotnet-setup@v1.0.0 | ||
with: | ||
# Use version defined in 'global.json' | ||
dotnet-version: '' | ||
disable-problem-matcher: false | ||
global-json-file: ${{ env.DOTNET_GLOBAL_JSON }} | ||
problem-matcher: true | ||
|
||
- name: .NET Restore | ||
uses: flobernd/actions/dotnet/restore@master | ||
with: | ||
workspace: ${{ steps.find.outputs.solution }} | ||
cache-key: ${{ hashFiles('**/packages.lock.json') }} | ||
# TODO: This step should honor the directory input for hashing | ||
cache-key: ${{ hashFiles(env.RESTORE_PATTERN) }} | ||
|
||
- name: SonarCloud Names | ||
id: sonarcloud-names | ||
|
@@ -185,11 +183,10 @@ jobs: | |
- name: .NET Test | ||
uses: flobernd/actions/dotnet/test@master | ||
with: | ||
projects: '**/*.Test*.csproj' | ||
projects: ${{ env.TESTS_PATTERN }} | ||
log-results: true | ||
collect-coverage: true | ||
maxdop: 4 | ||
# TODO: This step should honor the directory input for test discovery | ||
|
||
- name: SonarCloud End | ||
uses: flobernd/actions/sonarcloud/end@master | ||
|
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# ZySharp Template | ||
# ZySharp Workflows | ||
|
||
To be replaced by a meaningful description. | ||
|
||
## License | ||
|
||
ZySharp Template is licensed under the MIT license. | ||
ZySharp Workflows is licensed under the MIT license. |