Bump the nuget-dependencies group with 8 updates #220
Workflow file for this run
This file contains hidden or 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: Build and Test | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: read | |
packages: read | |
actions: read | |
jobs: | |
build: | |
runs-on: windows-latest | |
timeout-minutes: 10 | |
outputs: | |
VERSION: ${{ steps.get_version.outputs.VERSION }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup .NET Core SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.0.x' | |
- name: Set version | |
id: get_version | |
shell: pwsh | |
run: | | |
$TAG = if ($env:GITHUB_REF -like "refs/tags/v*") { | |
$env:GITHUB_REF -replace 'refs/tags/v', '' | |
} else { | |
"" | |
} | |
if ($TAG -ne "") { | |
$VERSION = $TAG | |
} else { | |
# Fallback to commit hash if no tag | |
$COMMIT_HASH = git rev-parse --short HEAD | |
$VERSION = "0.0.1-$COMMIT_HASH" | |
} | |
echo "VERSION=$VERSION" >> $env:GITHUB_OUTPUT | |
- name: Generate SBOM for the project | |
uses: advanced-security/generate-sbom-action@v1 | |
id: gensbom | |
- name: Build AggregateConfigBuildTask solution in Release mode | |
run: dotnet build src/dirs.proj --configuration Release -warnaserror -p:Version=${{ steps.get_version.outputs.VERSION }} | |
- name: Run tests for AggregateConfigBuildTask solution | |
run: dotnet test src/dirs.proj --configuration Release -warnaserror -p:Version=${{ steps.get_version.outputs.VERSION }} -p:CollectCoverage=true --no-build | |
- name: Upload SBOM artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sbom | |
path: ${{ steps.gensbom.outputs.fileName }} | |
- name: Upload NuGetPackage artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: NuGetPackage | |
path: | | |
src/Task/bin/Release/AggregateConfigBuildTask.${{ steps.get_version.outputs.VERSION }}.nupkg | |
src/Task/bin/Release/AggregateConfigBuildTask.${{ steps.get_version.outputs.VERSION }}.snupkg | |
integration_tests: | |
needs: build | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 10 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Setup .NET Core SDK | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.0.x' | |
- name: Download NuGetPackage artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: NuGetPackage | |
path: ./nuget/local | |
- name: Add local NuGet source | |
run: dotnet nuget add source ${{ github.workspace }}/nuget/local --name AggregateConfigBuildTask | |
- name: Build IntegrationTests in Release mode | |
run: dotnet build test/dirs.proj --configuration Release -warnaserror -p:Version=${{ needs.build.outputs.VERSION }} -p:UseLocalPackageVersion=true | |
- name: Run IntegrationTests | |
run: dotnet test test/dirs.proj --configuration Release -warnaserror -p:Version=${{ needs.build.outputs.VERSION }} -p:CollectCoverage=true -p:UseLocalPackageVersion=true | |
- name: Upload integration results artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: IntegrationTestResults-${{ matrix.os }} | |
path: test/IntegrationTests/out/ |