Update dependency Microsoft.Build.Locator to v1.7.1 - autoclosed #224
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
name: "Main workflow" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- '**' | |
jobs: | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
include: | |
- os: ubuntu-latest | |
buildConfiguration: "Release" | |
- os: windows-latest | |
buildConfiguration: "TestWindows" | |
- os: macos-latest | |
buildConfiguration: "Release" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup dotnet 6.0.x | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "6.0.x" | |
- name: Setup dotnet 7.0.x | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "7.0.x" | |
- name: Setup dotnet 8.0.x | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: "8.0.x" | |
- name: restore | |
run: dotnet restore | |
- name: build | |
run: dotnet build --configuration ${{ matrix.buildConfiguration }} --no-restore | |
- name: test | |
run: dotnet test --configuration ${{ matrix.buildConfiguration }} --no-restore | |
check_code_format: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: restore | |
run: dotnet restore | |
- name: check format | |
run: dotnet format --verify-no-changes | |
check_licenses: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
targetFramework: [net6.0, net7.0, net8.0] | |
project: [App, Tests] | |
include: | |
- targetFramework: net6.0 | |
dotnetVersion: "6.0.x" | |
- targetFramework: net7.0 | |
dotnetVersion: "7.0.x" | |
- targetFramework: net8.0 | |
dotnetVersion: "8.0.x" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup dotnet ${{ matrix.dotnetVersion }} | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnetVersion }} | |
- name: restore | |
run: dotnet restore -p:TargetFramework=${{ matrix.targetFramework }} | |
- name: build | |
run: dotnet publish ./src/NuGetUtility/NuGetUtility.csproj --configuration Release -o ./release -f ${{ matrix.targetFramework }} --no-restore | |
- name: check | |
run: dotnet ./release/NuGetUtility.dll -ji ./.github/workflows/assets/${{ matrix.project }}/projectsToCheck.json -t -a ./.github/workflows/assets/${{ matrix.project }}/allowedLicenses.json -o JsonPretty -override ./.github/workflows/assets/${{ matrix.project }}/overwritePackageInformation.json -ignore ./.github/workflows/assets/${{ matrix.project }}/ignorePackages.json -mapping ./.github/workflows/assets/${{ matrix.project }}/urlToLicenseMapping.json -d ./licenses/${{ matrix.project }}/${{ matrix.targetFramework }} | |
- name: show downloaded licenses | |
shell: pwsh | |
run: | | |
foreach($file in Get-ChildItem -Path ./licenses/${{ matrix.project }}/${{ matrix.targetFramework }}) | |
{ | |
Write-Host ::group::$file | |
Get-Content $file.FullName | |
Write-Host ::endgroup:: | |
} | |
check_version_command: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
targetFramework: [net6.0, net7.0, net8.0] | |
include: | |
- targetFramework: net6.0 | |
dotnetVersion: "6.0.x" | |
- targetFramework: net7.0 | |
dotnetVersion: "7.0.x" | |
- targetFramework: net8.0 | |
dotnetVersion: "8.0.x" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup dotnet ${{ matrix.dotnetVersion }} | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnetVersion }} | |
- name: restore | |
run: dotnet restore -p:TargetFramework=${{ matrix.targetFramework }} | |
- uses: paulhatch/[email protected] | |
id: version | |
name: version | |
with: | |
tag_prefix: "v" | |
version_format: "${major}.${minor}.${patch}-test${increment}" | |
- name: build | |
run: dotnet publish ./src/NuGetUtility/NuGetUtility.csproj --configuration Release -o ./release -f ${{ matrix.targetFramework }} --no-restore -p:Version=${{ steps.version.outputs.version }} | |
- name: check app version | |
shell: pwsh | |
run: | | |
$cmdOutput = dotnet ./release/NuGetUtility.dll --version | Out-String | |
if(!($cmdOutput.Trim() -like '${{ steps.version.outputs.version }}')) { | |
Write-Host Versions do not match: read $cmdOutput, expected ${{ steps.version.outputs.version }} | |
exit 1; | |
} |