Skip to content

Commit 3076bd5

Browse files
author
Petr Sramek
committed
testing repository variables
1 parent a83b9df commit 3076bd5

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

.github/workflows/dotnet.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,23 @@ name: .NET
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: [ $default-branch ]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: [ $default-branch ]
8+
9+
env:
10+
dotnet_version: ${{ vars.DOTNET_VERSION }}
811

912
jobs:
1013
build:
11-
name: Build with .NET 9
14+
name: Build with .NET $dotnet_version
1215
runs-on: ubuntu-latest
1316
steps:
1417
- uses: actions/checkout@v3
15-
- name: Install .NET 9
18+
- name: Install .NET $dotnet_version
1619
uses: actions/setup-dotnet@v4
1720
with:
18-
dotnet-version: 9.x
21+
dotnet-version: $dotnet_version
1922
- name: Build
2023
run: dotnet build ./src/**/*.csproj --configuration Release /p:Platform=AnyCPU
2124
- name: Upload
@@ -27,15 +30,15 @@ jobs:
2730
**/obj/*
2831
2932
test:
30-
name: Test with MsTest
33+
name: Test with .NET $dotnet_version
3134
needs: [build]
3235
runs-on: ubuntu-latest
3336
steps:
3437
- uses: actions/checkout@v3
35-
- name: Setup .NET 9
38+
- name: Setup .NET $dotnet_version
3639
uses: actions/setup-dotnet@v4
3740
with:
38-
dotnet-version: 9.x
41+
dotnet-version: $dotnet_version
3942
- name: Test
4043
run: dotnet test ./tests/**/*Tests.csproj --configuration Release /p:Platform=AnyCPU --verbosity normal --settings unit-test.runsettings --logger trx --collect:"Code Coverage" --results-directory test-results
4144
- name: Upload
@@ -46,15 +49,15 @@ jobs:
4649
**/test-results/*
4750
4851
pack:
49-
name: Pack with .NET 9
52+
name: Pack with .NET $dotnet_version
5053
needs: [test]
5154
runs-on: ubuntu-latest
5255
steps:
5356
- uses: actions/checkout@v3
54-
- name: Install .NET 9
57+
- name: Install .NET $dotnet_version
5558
uses: actions/setup-dotnet@v4
5659
with:
57-
dotnet-version: 9.x
60+
dotnet-version: $dotnet_version
5861
- name: Download
5962
uses: actions/download-artifact@v4
6063
with:

0 commit comments

Comments
 (0)