Skip to content

Commit

Permalink
Use msbuild -p argument to specify TargetFrameworks override under CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mqudsi committed Mar 2, 2024
1 parent 4a02fec commit a5bb6a4
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
dotnet: [ '3.1', '5.0', '6.0', '8.0' ]
dotnet: [ '6.0', '8.0' ]

steps:
- uses: actions/checkout@v4
Expand All @@ -24,17 +24,11 @@ jobs:
with:
dotnet-version: ${{ matrix.dotnet }}
# By default, tests will be executed under the latest installed version!
# - name: Create temporary global.json
# run: echo '{"sdk":{"version":"${{steps.stepid.outputs.dotnet-version}}"}}' > ./global.json
- name: Restore nuget dependencies
run: dotnet restore
- name: Create temporary global.json
run: echo '{"sdk":{"version":"${{steps.stepid.outputs.dotnet-version}}"}}' > ./global.json
- name: Restore packages
run: dotnet restore -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest"
- name: Build solution
run: dotnet build --no-restore --configuration Release --verbosity detailed
run: dotnet build --no-restore --configuration Release -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest" --verbosity detailed
- name: Run tests
run: dotnet test --configuration Release --no-build --verbosity normal
# - name: Build solution
# # Specify the path to the test project and not the solution because using --framework requires an
# # exact string match in each csproj, but our library uses netstandard2.1 and not a specific netx.y
# run: dotnet build --configuration Release --framework ${{ matrix.dotnet }} SqliteCache.Tests/SqliteCache.Tests.csproj
# - name: Run tests
# run: dotnet test --configuration Release --no-build --verbosity normal --framework ${{ matrix.dotnet }}
run: dotnet test --configuration Release --no-build --verbosity detailed -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest"

0 comments on commit a5bb6a4

Please sign in to comment.