-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored condition checks in GitHub workflow
- Updated the conditional statements in the GitHub workflow file to correctly reference the `change_detection` step. - This change affects all tasks that rely on this condition, ensuring they only run when changes are detected. - The affected tasks include dotnet installation, gitversion setup and execution, nuget caching, dotnet restore/build/test operations, test reporting, and artifact gathering/uploading.
- Loading branch information
1 parent
8e7f7fa
commit 223dc9e
Showing
1 changed file
with
10 additions
and
10 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 |
---|---|---|
|
@@ -43,27 +43,27 @@ jobs: | |
- name: tools - dotnet - install | ||
if: ${{ change_detection.outputs.build == 'true' }} | ||
if: ${{ steps.change_detection.outputs.build == 'true' }} | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '8.x' | ||
|
||
- name: tools - gitversion - install | ||
if: ${{ change_detection.outputs.build == 'true' }} | ||
if: ${{ steps.change_detection.outputs.build == 'true' }} | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
versionSpec: '5.x' | ||
preferLatestVersion: true | ||
|
||
- name: tools - gitversion - execute | ||
if: ${{ change_detection.outputs.build == 'true' }} | ||
if: ${{ steps.change_detection.outputs.build == 'true' }} | ||
uses: gittools/actions/gitversion/[email protected] | ||
with: | ||
useConfigFile: true | ||
configFilePath: GitVersion.yaml | ||
|
||
- name: cache - nuget | ||
if: ${{ change_detection.outputs.build == 'true' }} | ||
if: ${{ steps.change_detection.outputs.build == 'true' }} | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.nuget/packages | ||
|
@@ -72,36 +72,36 @@ jobs: | |
${{ runner.os }}-nuget- | ||
- name: dotnet restore | ||
if: ${{ change_detection.outputs.build == 'true' }} | ||
if: ${{ steps.change_detection.outputs.build == 'true' }} | ||
shell: bash | ||
run: dotnet restore | ||
|
||
- name: dotnet build | ||
if: ${{ change_detection.outputs.build == 'true' }} | ||
if: ${{ steps.change_detection.outputs.build == 'true' }} | ||
shell: bash | ||
run: dotnet build --no-restore --configuration Release /p:Version=${{env.GitVersion_SemVer}} /p:AssemblyVersion=${{env.GitVersion_AssemblySemFileVer}} /p:NuGetVersion=${{env.GitVersion_SemVer}} | ||
|
||
- name: dotnet test | ||
if: ${{ change_detection.outputs.build == 'true' }} | ||
if: ${{ steps.change_detection.outputs.build == 'true' }} | ||
shell: bash | ||
run: dotnet test --no-build --configuration Release --verbosity normal | ||
|
||
- name: test-reporter | ||
uses: dorny/test-reporter@v1 | ||
if: ${{ change_detection.outputs.build == 'true' }} | ||
if: ${{ steps.change_detection.outputs.build == 'true' }} | ||
with: | ||
name: Test Results | ||
path: .artifacts/TestResults/*.trx | ||
reporter: dotnet-trx | ||
|
||
- name: artifacts - nuget - gather | ||
if: ${{ change_detection.outputs.build == 'true' }} | ||
if: ${{ steps.change_detection.outputs.build == 'true' }} | ||
run: | | ||
mkdir -p .artifacts/nuget | ||
find . -name "*.nupkg" -exec cp {} .artifacts/nuget/ \; | ||
- name: artifacts - nuget - upload | ||
if: ${{ change_detection.outputs.build == 'true' }} | ||
if: ${{ steps.change_detection.outputs.build == 'true' }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifacts-nuget | ||
|