Upgrade project dependencies and add support for net8.0 #22
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] | |
pull_request: | |
branches: [main, develop] | |
workflow_dispatch: | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
dotnet: [8.x, 6.x] | |
framework: [net6.0] | |
os: [ubuntu-latest, windows-latest] | |
platform: [Any CPU] | |
config: [Debug, Release] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ matrix.dotnet }} | |
cache: true | |
cache-dependency-path: src/Mycoshiro.Dataverse.LINQPad/packages.lock.json | |
env: | |
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | |
- name: Restore dependencies | |
run: dotnet restore --locked-mode | |
# 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 | |
--no-restore | |
--configuration "${{ matrix.config }}" | |
-p:Platform="${{ matrix.platform }}" | |
--framework "${{ matrix.framework }}" | |
--verbosity normal | |
--graph | |
- name: Test | |
run: > | |
dotnet test | |
--no-build | |
--no-restore | |
--configuration "${{ matrix.config }}" | |
-p:Platform="${{ matrix.platform }}" | |
--framework "${{ matrix.framework }}" | |
--verbosity normal | |
--collect:"XPlat Code Coverage" | |
--results-directory:./TestResults | |
--logger:trx | |
- uses: bibipkins/dotnet-test-reporter@v1.4.0 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
comment-title: "Unit Test Results" | |
results-path: ./TestResults/*.trx | |
#coverage-path: ./TestResults/coverage.xml | |
#coverage-threshold: 80 | |
#- name: Create the package | |
# run: dotnet pack --configuration Release | |
#- name: Publish the package to GPR | |
# run: dotnet nuget push bin/Release/AnyCPU/*.nupkg | |
#- name: Create the package | |
# id: create-package | |
# run: | | |
# $version = "$(Get-Date -Format "yyyy.MM.dd").${{ github.run_number }}"; | |
# dotnet pack --configuration ${{ env.buildConfig }}; | |
# Compress-Archive bin/Release/netcoreapp*/* bin/Release/netcoreapp*/Mycoshiro.Dataverse.LINQPad.lpx6 -Verbose; | |
# echo "::set-output name=driverFileName::Mycoshiro.Dataverse.LINQPad_$version.lpx6"; | |
# echo "::set-output name=driverFileVersion::$version"; | |
#- name: Create Release | |
# id: create_release | |
# uses: actions/create-release@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# tag_name: ${{ steps.create-package.outputs.driverFileVersion }} | |
# release_name: ${{ steps.create-package.outputs.driverFileName }} | |
# draft: true | |
# prerelease: false | |
#- name: Upload LINQPad Driver | |
# id: release-managed-solution | |
# if: steps.create_release.conclusion == 'success' | |
# uses: actions/upload-release-asset@v1 | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# with: | |
# upload_url: ${{ steps.create_release.outputs.upload_url }} | |
# asset_path: bin/Release/netcoreapp*/Mycoshiro.Dataverse.LINQPad.lpx6 | |
# asset_name: ${{ steps.create-package.outputs.driverFileName }} | |
# asset_content_type: application/zip | |
#- name: Publish the package to GPR | |
# run: dotnet nuget push bin/Release/*.nupkg |