-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (128 loc) · 3.47 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
# Disabled Release for now, not sure if it's needed or not still working out the release workflow
# repository_dispatch:
# types: [ release ]
permissions:
contents: read
packages: write
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_NOLOGO: 1
jobs:
prepare:
name: Prepare
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
# Setup
- name: Setup Job
id: setup-job
uses: ./.github/actions/setup-job
with:
dotnet_sdk_version: ${{ vars.DOTNET_SDK_VERSION }}
ignore_dotnet_on_cake_cache_hit: true
# Prepare
- name: '[Prepare]'
if: steps.setup-job.outputs.cake-cache-hit != 'true'
run: dotnet build build/CI.sln -c Release
package:
name: Package
needs: [prepare]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
# Setup
- name: Setup Job
uses: ./.github/actions/setup-job
with:
dotnet_sdk_version: ${{ vars.DOTNET_SDK_VERSION }}
# Package
- name: '[Package]'
run: dotnet run/build.dll --target=Package
# Upload Packages
- name: 'Upload Packages'
uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu-latest'
with:
name: packages
path: ${{ github.workspace }}/artifacts/packages
test:
name: Test
needs: [prepare]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
targetFramework: [net6.0, net7.0, net8.0]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
# Setup
- name: Setup Job
uses: ./.github/actions/setup-job
with:
dotnet_sdk_version: ${{ vars.DOTNET_SDK_VERSION }}
# Test
- name: '[Test]'
run: dotnet run/build.dll --target=Test --target_framework=${{ matrix.targetFramework }}
# Report
- name: Test Summary
uses: test-summary/action@v2
if: matrix.targetFramework == 'net8.0'
with:
paths: artifacts/test-results/*.results.xml
publish:
name: Publish
needs: [package, test]
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
# Setup
- name: Setup Job
uses: ./.github/actions/setup-job
with:
dotnet_sdk_version: ${{ vars.DOTNET_SDK_VERSION }}
# Download Packages
- uses: actions/download-artifact@v4
name: Download Packages
with:
name: packages
path: ${{ github.workspace }}/artifacts/packages
# Publish
- name: '[Publish]'
run: dotnet run/publish.dll --target=PublishNuGet