ci: Workflow changes for GitVersion

pull/47/head
Robert Dailey 3 years ago
parent d9086895f0
commit 390f6c713c

@ -34,10 +34,7 @@ jobs:
- name: Checkout Source Code - name: Checkout Source Code
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 # avoid shallow clone for NBGV fetch-depth: 0 # avoid shallow clone for GitVersion
- uses: dotnet/nbgv@master
id: nbgv
- name: Setup .NET Core SDK ${{ env.dotnetVersion }} - name: Setup .NET Core SDK ${{ env.dotnetVersion }}
uses: actions/setup-dotnet@v1 uses: actions/setup-dotnet@v1
@ -67,17 +64,22 @@ jobs:
- name: Get Source Code - name: Get Source Code
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 fetch-depth: 0 # avoid shallow clone for GitVersion
- name: Setup NBGV
uses: dotnet/nbgv@master
id: nbgv
- name: Setup dotnet - name: Setup dotnet
uses: actions/setup-dotnet@v1 uses: actions/setup-dotnet@v1
with: with:
dotnet-version: ${{ env.dotnetVersion }} dotnet-version: ${{ env.dotnetVersion }}
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: 5.x
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.7
id: gitversion
- name: Install Sonar Scanner - name: Install Sonar Scanner
run: dotnet tool install --global dotnet-sonarscanner run: dotnet tool install --global dotnet-sonarscanner
@ -87,7 +89,7 @@ jobs:
-o:"rcdailey" -o:"rcdailey"
-k:"rcdailey_trash-updater" -k:"rcdailey_trash-updater"
-n:"Trash Updater" -n:"Trash Updater"
-v:"${{ steps.nbgv.outputs.SimpleVersion }}" -v:"${{ steps.gitversion.outputs.fullSemVer }}"
-d:sonar.login="${{ secrets.SONAR_TOKEN }}" -d:sonar.login="${{ secrets.SONAR_TOKEN }}"
-d:sonar.host.url="https://sonarcloud.io" -d:sonar.host.url="https://sonarcloud.io"
-d:sonar.cs.opencover.reportsPaths="**/TestResults/*/coverage.opencover.xml" -d:sonar.cs.opencover.reportsPaths="**/TestResults/*/coverage.opencover.xml"
@ -97,7 +99,11 @@ jobs:
run: dotnet build src run: dotnet build src
- name: Test - name: Test
run: dotnet test src --collect:"XPLat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover run: >
dotnet test src
--no-build
--collect:"XPLat Code Coverage"
-- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
- name: End Sonar Scanner - name: End Sonar Scanner
run: > run: >
@ -113,18 +119,17 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 0 # avoid shallow clone for NBGV fetch-depth: 0 # avoid shallow clone for GitVersion
# token: ${{ secrets.GITHUB_TOKEN }} # Allows git push # token: ${{ secrets.GITHUB_TOKEN }} # Allows git push
- name: Set up NBGV - name: Install GitVersion
uses: dotnet/nbgv@master uses: gittools/actions/gitversion/setup@v0.9.7
id: nbgv with:
versionSpec: 5.x
- name: Verify tag matches version.json - name: Determine Version
if: endsWith(github.ref, steps.nbgv.outputs.SimpleVersion) != true uses: gittools/actions/gitversion/execute@v0.9.7
run: | id: gitversion
echo "The tag ${{ github.ref }} does not match version.json: ${{ steps.nbgv.outputs.SimpleVersion }}"
exit 1
- name: Download Artifacts - name: Download Artifacts
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2
@ -144,4 +149,4 @@ jobs:
body: ${{ steps.changelog.outputs.release_notes }} body: ${{ steps.changelog.outputs.release_notes }}
tag_name: ${{ github.event.create.ref }} tag_name: ${{ github.event.create.ref }}
draft: false draft: false
prerelease: ${{ steps.nbgv.outputs.PrereleaseVersion != '' }} prerelease: ${{ steps.gitversion.outputs.preReleaseTag != '' }}

Loading…
Cancel
Save