Skip to content

Commit b098362

Browse files
Remove unnecessary Node.js setup and create reusable .NET setup action
Co-authored-by: BenjaminMichaelis <[email protected]>
1 parent fcd4dc9 commit b098362

File tree

4 files changed

+35
-51
lines changed

4 files changed

+35
-51
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: 'Setup .NET Environment'
2+
description: 'Set up .NET SDK and configure dependency caching for faster builds'
3+
inputs:
4+
dotnet-version:
5+
description: 'Specific .NET version(s) to install'
6+
required: false
7+
default: ''
8+
use-global-json:
9+
description: 'Use global.json file for .NET version'
10+
required: false
11+
default: 'true'
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- name: Setup dotnet SDK
16+
uses: actions/setup-dotnet@v5
17+
with:
18+
dotnet-version: ${{ inputs.dotnet-version || '' }}
19+
global-json-file: ${{ inputs.use-global-json == 'true' && 'global.json' || '' }}
20+
21+
- name: Set up dependency caching for faster builds
22+
uses: actions/cache@v4
23+
id: nuget-cache
24+
with:
25+
path: |
26+
~/.nuget/packages
27+
${{ github.workspace }}/**/obj/project.assets.json
28+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
31+
${{ runner.os }}-nuget-

.github/workflows/copilot-setup-steps.yml

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,28 +21,8 @@ jobs:
2121
- name: Checkout code
2222
uses: actions/checkout@v5
2323

24-
- name: Setup Node.js
25-
uses: actions/setup-node@v4
26-
with:
27-
node-version: '20'
28-
cache: 'npm'
24+
- name: Setup .NET environment
25+
uses: ./.github/actions/setup-dotnet
2926

30-
- name: Install JavaScript dependencies
31-
run: npm ci
32-
33-
- name: Setup dotnet SDK
34-
uses: actions/setup-dotnet@v5
35-
with:
36-
global-json-file: global.json
37-
38-
- name: Set up dependency caching for faster builds
39-
uses: actions/cache@v4
40-
id: nuget-cache
41-
with:
42-
path: |
43-
~/.nuget/packages
44-
${{ github.workspace }}/**/obj/project.assets.json
45-
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
46-
restore-keys: |
47-
${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
48-
${{ runner.os }}-nuget-
27+
- name: Restore dependencies
28+
run: dotnet restore

package-lock.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

package.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)