-
-
Notifications
You must be signed in to change notification settings - Fork 3
91 lines (82 loc) · 2.5 KB
/
ci.yml
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: DotNet
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
branches: [main]
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
POWERSHELL_TELEMETRY_OPTOUT: 1
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
jobs:
build:
runs-on: ${{ matrix.os }}
name: Test
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
cache: [true, false]
include:
- os: windows-2019
cache: false
DOTNET_INSTALL_DIR: D:\dotnet
- os: windows-2022
cache: false
DOTNET_INSTALL_DIR: D:\dotnet
- os: windows-2019
cache: true
DOTNET_INSTALL_DIR: D:\dotnet
- os: windows-2022
cache: true
DOTNET_INSTALL_DIR: D:\dotnet
- os: windows-2019
cache: false
DOTNET_INSTALL_DIR: ''
- os: windows-2022
cache: false
DOTNET_INSTALL_DIR: ''
- os: windows-2019
cache: true
DOTNET_INSTALL_DIR: ''
- os: windows-2022
cache: true
DOTNET_INSTALL_DIR: ''
fail-fast: false
steps:
- name: Collect Workflow Telemetry
uses: catchpoint/workflow-telemetry-action@v2
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set Windows Environment Variables
if: ${{ startsWith(matrix.os, 'windows') && matrix.DOTNET_INSTALL_DIR != '' }}
shell: pwsh
run: |
echo "DOTNET_INSTALL_DIR=${{ matrix.DOTNET_INSTALL_DIR }}" >> $ENV:GITHUB_ENV
echo "NUGET_PACKAGES=D:\nuget\packages" >> $ENV:GITHUB_ENV
- name: Print matrix values
run: |
echo "OS: ${{ matrix.os }}"
echo "Cache: ${{ matrix.cache }}"
echo "DOTNET_INSTALL_DIR: ${{ matrix.DOTNET_INSTALL_DIR }}"
echo "NUGET_PACKAGES: ${{ env.NUGET_PACKAGES }}"
- name: Cache NuGet packages
if: matrix.cache
uses: actions/cache@v4
with:
path: ${{ env.NUGET_PACKAGES }}
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: ${{ runner.os }}-nuget-
- name: Setup DotNet 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
dotnet-quality: 'preview'
- name: DotNet restore
run: |
dotnet new nugetconfig
dotnet restore -v n