Skip to content

Commit a5bb6a4

Browse files
committed
Use msbuild -p argument to specify TargetFrameworks override under CI
1 parent 4a02fec commit a5bb6a4

File tree

1 file changed

+7
-13
lines changed

1 file changed

+7
-13
lines changed

.github/workflows/dotnet.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [ubuntu-latest, windows-latest, macos-latest]
17-
dotnet: [ '3.1', '5.0', '6.0', '8.0' ]
17+
dotnet: [ '6.0', '8.0' ]
1818

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

0 commit comments

Comments
 (0)