File tree Expand file tree Collapse file tree
actions/setup-dotnet-build Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : ' Setup .NET and Build'
2+ description : ' Sets up .NET environment, restores dependencies, and builds the project'
3+ inputs :
4+ dotnet-version :
5+ description : ' .NET versions to install'
6+ required : false
7+ default : |
8+ 3.1.x
9+ 6.x
10+ configuration :
11+ description : ' Build configuration'
12+ required : false
13+ default : ' Release'
14+ build-args :
15+ description : ' Additional build arguments'
16+ required : false
17+ default : ' -p:ContinuousIntegrationBuild=True --no-restore'
18+
19+ runs :
20+ using : ' composite'
21+ steps :
22+ - name : Setup .NET
23+ uses : actions/setup-dotnet@v4
24+ with :
25+ dotnet-version : ${{ inputs.dotnet-version }}
26+
27+ - name : Restore dependencies
28+ run : dotnet restore
29+ shell : pwsh
30+
31+ - name : Build
32+ run : dotnet build --configuration ${{ inputs.configuration }} ${{ inputs.build-args }}
33+ shell : pwsh
Original file line number Diff line number Diff line change 2020 os : [ubuntu-latest, windows-latest, macOS-latest]
2121 steps :
2222 - uses : actions/checkout@v4
23- - name : Setup .NET
24- uses : actions/setup-dotnet@v4
25- with :
26- dotnet-version : |
27- 3.1.x
28- 6.x
29- - name : Restore dependencies
30- run : dotnet restore
31- - name : Build
32- run : dotnet build -p:ContinuousIntegrationBuild=True --no-restore --configuration Release
23+ - name : Setup .NET and Build
24+ uses : ./.github/actions/setup-dotnet-build
3325 - name : Test
3426 run : dotnet test --no-build --configuration Release --verbosity normal
3527
Original file line number Diff line number Diff line change @@ -25,15 +25,10 @@ jobs:
2525 - name : Checkout code
2626 uses : actions/checkout@v5
2727
28- - name : Setup .NET
29- uses : actions/setup-dotnet@v4
28+ - name : Setup .NET and Build
29+ uses : ./.github/ actions/setup-dotnet-build
3030 with :
31- dotnet-version : |
32- 3.1.x
33- 6.x
34-
35- - name : Restore .NET dependencies
36- run : dotnet restore
31+ configuration : ' Release'
3732
3833 - name : Setup Copilot environment
3934 run : |
You can’t perform that action at this time.
0 commit comments