forked from dotnet/try
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathaction.yml
More file actions
38 lines (35 loc) · 1.18 KB
/
action.yml
File metadata and controls
38 lines (35 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: 'Setup .NET Environment'
description: 'Set up .NET SDK, configure dependency caching, restore, and optionally build'
inputs:
build:
description: 'Whether to run dotnet build after restore'
required: false
default: 'true'
configuration:
description: 'What configuration to run (e.g., Release or Debug)'
required: false
default: 'Release'
runs:
using: 'composite'
steps:
- name: Set up .NET
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json
- name: Set up dependency caching for faster builds
uses: actions/cache@v5
with:
path: |
~/.nuget/packages
${{ github.workspace }}/**/obj/project.assets.json
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
${{ runner.os }}-nuget-
- name: Restore .NET dependencies
shell: bash
run: dotnet restore
- name: Build with dotnet
if: inputs.build == 'true'
shell: bash
run: dotnet build -p:ContinuousIntegrationBuild=True --configuration ${{ inputs.configuration }} --no-restore