Update GitHub build workflow #114
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: ".NET" | |
on: | |
push: | |
branches: [main, develop, release] | |
pull_request: | |
branches: [main, develop, release] | |
workflow_dispatch: | |
permissions: | |
contents: read | |
id-token: write | |
checks: write | |
pull-requests: write | |
env: | |
PROJECT_NAME: NY.Dataverse.LINQPadDriver | |
PROJECT_SOURCE_ROOT: src | |
PROJECT_FETCH_XML: MarkMpn.FetchXmlToWebAPI | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
dotnet: [8.x] | |
os: [windows-latest] | |
runtime: [win-x64] | |
config: [Debug, Release] | |
runs-on: ${{ matrix.os }} | |
# Build: dotnet-8.x, win-x64, Debug | |
name: "🪟🔥 Build | ${{ matrix.config }}" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet }} | |
- name: Restore dependencies | |
run: > | |
dotnet restore --locked-mode | |
"${{ env.PROJECT_NAME }}.sln" | |
# The '--graph' parameter is to address an occasional build error about files being | |
# used by another process the during 'GenerateRuntimeConfigurationFiles' | |
# task: https://github.com/dotnet/msbuild/issues/6690#issuecomment-1553272562 | |
- name: Build | |
run: > | |
dotnet build | |
--configuration "${{ matrix.config }}" | |
--runtime "${{ matrix.runtime }}" | |
--verbosity normal | |
--graph | |
"${{ env.PROJECT_SOURCE_ROOT }}/${{ env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}.csproj" | |
- name: Test | |
run: > | |
dotnet test | |
--configuration "${{ matrix.config }}" | |
--runtime "${{ matrix.runtime }}" | |
--verbosity normal | |
--results-directory:"./TestResults/${{ matrix.dotnet }}-${{ matrix.runtime }}-${{ matrix.config }}" | |
--logger:trx | |
"${{ env.PROJECT_SOURCE_ROOT }}/${{ env.PROJECT_FETCH_XML }}/${{ env.PROJECT_FETCH_XML }}.Tests/${{ env.PROJECT_FETCH_XML }}.Tests.csproj" | |
- uses: bibipkins/dotnet-test-reporter@v1.4.1 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
comment-title: "Unit Test Results" | |
results-path: "./TestResults/${{ matrix.dotnet }}-${{ matrix.runtime }}-${{ matrix.config }}/*.trx" |