Skip to content

Commit 0fae68c

Browse files
committed
Improve CI
1 parent 68bee3c commit 0fae68c

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,22 @@ on:
77
pull_request:
88
branches: [ main ]
99

10+
permissions:
11+
contents: read
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
env:
18+
DOTNET_NOLOGO: 1
19+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
20+
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
21+
1022
jobs:
1123
build_test:
1224
runs-on: windows-latest
25+
timeout-minutes: 45
1326

1427
steps:
1528
- name: Checkout
@@ -18,26 +31,25 @@ jobs:
1831
- name: Setup .NET SDK
1932
uses: actions/setup-dotnet@v6
2033
with:
21-
dotnet-version: |
22-
10.0.x
23-
11.0.x
34+
dotnet-version: 11.0.x
2435

2536
- name: Show dotnet info
2637
run: dotnet --info
2738

2839
- name: Cache NuGet packages
2940
uses: actions/cache@v6
3041
with:
31-
path: ~/.nuget/packages
32-
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', '**/Directory.Packages.props', '**/global.json', '**/nuget.config') }}
42+
path: ${{ env.NUGET_PACKAGES }}
43+
key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets', '**/global.json', '**/nuget.config', '**/packages.lock.json') }}
3344
restore-keys: |
3445
nuget-${{ runner.os }}-
3546
3647
- name: Restore
37-
run: dotnet restore --nologo
48+
run: dotnet restore --nologo -p:NuGetAudit=true
3849

3950
- name: Build
40-
run: dotnet build -c Release --no-restore --nologo -warnaserror
51+
run: dotnet build -c Release --no-restore --nologo -warnaserror -p:ContinuousIntegrationBuild=true
4152

53+
# Tests use the Microsoft.Testing.Platform runner (MSTest.Sdk), which does not accept the VSTest --logger option.
4254
- name: Test
43-
run: dotnet test --configuration Release --no-build
55+
run: dotnet test -c Release --no-build --no-restore --nologo

0 commit comments

Comments
 (0)