Bump xunit from 2.5.1 to 2.6.1 #445
Workflow file for this run
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
# based on https://dusted.codes/github-actions-for-dotnet-core-nuget-packages | |
name: Build CI | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
env: | |
# Stop wasting time caching packages | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
# Disable sending usage data to Microsoft | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
# Project name to pack and publish | |
PROJECT_NAME: AspNetCore.VersionInfo | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
CONFIGURATION: "Release" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Fetch all history for all tags and branches | |
run: git fetch --prune --unshallow | |
- name: Install GitVersion | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: '5.x' | |
- name: Use GitVersion | |
id: gitversion # step id used as reference for output values | |
uses: gittools/actions/gitversion/[email protected] | |
- name: Build info | |
run: | | |
echo "Build Info" | |
echo "-----------------------------------------------------------------------" | |
echo "Configuration: $CONFIGURATION" | |
echo "Run ID: ${{ github.run_id }}" | |
echo "Output Run Number: ${{ github.run_number }}" | |
echo "Major: ${{ steps.gitversion.outputs.Major }}" | |
echo "Minor: ${{ steps.gitversion.outputs.Minor }}" | |
echo "Patch: ${{ steps.gitversion.outputs.Patch }}" | |
echo "PreReleaseTag: ${{ steps.gitversion.outputs.PreReleaseTag }}" | |
echo "PreReleaseTagWithDash: ${{ steps.gitversion.outputs.PreReleaseTagWithDash }}" | |
echo "PreReleaseLabel: ${{ steps.gitversion.outputs.PreReleaseLabel }}" | |
echo "PreReleaseNumber: ${{ steps.gitversion.outputs.PreReleaseNumber }}" | |
echo "WeightedPreReleaseNumber: ${{ steps.gitversion.outputs.WeightedPreReleaseNumber }}" | |
echo "BuildMetaData: ${{ steps.gitversion.outputs.BuildMetaData }}" | |
echo "BuildMetaDataPadded: ${{ steps.gitversion.outputs.BuildMetaDataPadded }}" | |
echo "FullBuildMetaData: ${{ steps.gitversion.outputs.FullBuildMetaData }}" | |
echo "MajorMinorPatch: ${{ steps.gitversion.outputs.MajorMinorPatch }}" | |
echo "SemVer: ${{ steps.gitversion.outputs.SemVer }}" | |
echo "LegacySemVer: ${{ steps.gitversion.outputs.LegacySemVer }}" | |
echo "LegacySemVerPadded: ${{ steps.gitversion.outputs.LegacySemVerPadded }}" | |
echo "AssemblySemVer: ${{ steps.gitversion.outputs.AssemblySemVer }}" | |
echo "AssemblySemFileVer: ${{ steps.gitversion.outputs.AssemblySemFileVer }}" | |
echo "FullSemVer: ${{ steps.gitversion.outputs.FullSemVer }}" | |
echo "InformationalVersion: ${{ steps.gitversion.outputs.InformationalVersion }}" | |
echo "BranchName: ${{ steps.gitversion.outputs.BranchName }}" | |
echo "Sha: ${{ steps.gitversion.outputs.Sha }}" | |
echo "ShortSha: ${{ steps.gitversion.outputs.ShortSha }}" | |
echo "NuGetVersionV2: ${{ steps.gitversion.outputs.NuGetVersionV2 }}" | |
echo "NuGetVersion: ${{ steps.gitversion.outputs.NuGetVersion }}" | |
echo "NuGetPreReleaseTagV2: ${{ steps.gitversion.outputs.NuGetPreReleaseTagV2 }}" | |
echo "NuGetPreReleaseTag: ${{ steps.gitversion.outputs.NuGetPreReleaseTag }}" | |
echo "VersionSourceSha: ${{ steps.gitversion.outputs.VersionSourceSha }}" | |
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}" | |
echo "CommitsSinceVersionSourcePadded: ${{ steps.gitversion.outputs.CommitsSinceVersionSourcePadded }}" | |
echo "CommitDate: ${{ steps.gitversion.outputs.CommitDate }}" | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Update project version | |
uses: roryprimrose/set-vs-sdk-project-version@v1 | |
with: | |
version: "${{ steps.gitversion.outputs.NuGetVersionV2 }}-preview.${{github.run_id}}.${{github.run_number}}" | |
assemblyVersion: "${{steps.gitversion.outputs.MajorMinorPatch}}.${{github.run_number}}" | |
fileVersion: "${{steps.gitversion.outputs.MajorMinorPatch}}.${{github.run_number}}" | |
informationalVersion: ${{ steps.gitversion.outputs.InformationalVersion }} | |
#if: ${{ github.event_name == 'pull_request' || github.ref == 'refs/heads/master' }} | |
- name: Update project version (release) | |
uses: roryprimrose/set-vs-sdk-project-version@v1 | |
with: | |
version: ${{ steps.gitversion.outputs.NuGetVersionV2 }} | |
assemblyVersion: ${{ steps.gitversion.outputs.AssemblySemVer }} | |
fileVersion: ${{ steps.gitversion.outputs.MajorMinorPatch }} | |
informationalVersion: ${{ steps.gitversion.outputs.InformationalVersion }} | |
if: startsWith(github.ref, 'refs/tags/') | |
#### Start SonarCloud steps | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: '11' | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/sonar/cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache SonarCloud scanner | |
id: cache-sonar-scanner | |
uses: actions/cache@v3 | |
with: | |
path: ~/.sonar/scanner | |
key: ${{ runner.os }}-sonar-scanner | |
restore-keys: ${{ runner.os }}-sonar-scanner | |
- name: Install SonarCloud scanner | |
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' | |
run: | | |
mkdir -p ~/.sonar/scanner | |
dotnet tool update dotnet-sonarscanner --tool-path ~/.sonar/scanner | |
- name: Start Sonarcloud | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: | | |
~/.sonar/scanner/dotnet-sonarscanner begin \ | |
/k:"salem84_AspNetCore.VersionInfo" \ | |
/o:"salem84" \ | |
/d:sonar.host.url="https://sonarcloud.io" \ | |
/d:sonar.login="${{ secrets.SONAR_TOKEN }}" \ | |
/d:sonar.cs.opencover.reportsPaths="**\coverage.opencover.xml" | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Normalize README.md for NuGet publish | |
run: | | |
sed -i 's|docs/images|https://raw.githubusercontent.com/${{ github.repository }}/master/docs/images|g' README.md | |
sed -i 's|<br\/>|,|g' README.md | |
sed -i 's|!\[/version/badge\](https:[^)]*)|/version/badge|g' README.md | |
sed -i 's|!\[\(.*\)\](\(https:\/\/via.placeholder.com[^)]*\))|\1|g' README.md | |
- name: Build | |
run: dotnet build --no-restore --configuration $CONFIGURATION | |
- name: Test | |
run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=coverage.opencover.xml | |
- name: Stop Sonarcloud | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
run: ~/.sonar/scanner/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" |