-
Notifications
You must be signed in to change notification settings - Fork 233
201 lines (171 loc) · 5.52 KB
/
minio-dotnet.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
name: Minio-dotnet Tests
on:
push:
branches: [ develop, main, master ]
pull_request:
branches: [ develop, master ]
# This ensures that previous jobs for the PR are canceled when the PR is
# updated.
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
env:
Solution_Name: Minio.sln
Test_Project_Path: ./Minio.Tests/Minio.Tests.csproj
Minio_Project_Path: ./Minio/Minio.csproj
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
configuration: [Release]
dotnet-version: ["7.0.x"]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Install .NET
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
# Cache NuGet packages
- name: Setup .NET Nuget cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-dotnet-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-dotnet-
# Install dependencies
- name: Install dependencies
run: |
dotnet restore ${{ env.Solution_Name }}
# Build
- name: Build
run: dotnet build ${{ env.Solution_Name }} --no-restore --configuration Release
# Create the Nuget
- name: Create the Nuget package
run: dotnet pack ${{ env.Minio_Project_Path }} --no-restore --no-build --configuration Release --output ./artifacts
# Upload the normal artifacts
- name: Upload the build output
uses: actions/upload-artifact@v3
with:
name: build-artifacts
path: |
**/bin/Release/
**/obj/Release/
**/*.csproj
**/*.key
**/*.crt
# Upload the Nuget packages
- name: Upload the Nuget packages output
uses: actions/upload-artifact@v3
with:
name: nuget-packages
path: ./artifacts/*
format-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
# Install .NET
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"
# Install regitlint
- name: Install tool dependencies
run: |
dotnet tool restore
# Run lint
- name: Run lint
run: |
dotnet regitlint --fail-on-diff
unit_tests:
needs: build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
configuration: [Release]
dotnet-version: ["7.0.x"]
steps:
# Install .NET
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
# Download the build artifacts
- name: Download the build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts
path: .
# Execute build tests
- name: Build & Unit Test
run: dotnet test ${{ env.Test_Project_Path }} --no-restore --no-build --configuration Release
functional_tests:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
configuration: [Release]
dotnet-version: ["7.0.x"]
steps:
# Install .NET
- name: Setup .NET ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet-version }}
# Download the build artifacts
- name: Download the build artifacts
uses: actions/download-artifact@v3
with:
name: build-artifacts
path: .
# Execute all functional tests in the solution
- name: Execute Functional Tests Linux
env:
MINT_MODE: full
SERVER_ENDPOINT: localhost:9000
ACCESS_KEY: minio
SECRET_KEY: minio123
ENABLE_HTTPS: 1
ENABLE_KMS: 1
MINIO_ACCESS_KEY: minio
MINIO_SECRET_KEY: minio123
MINIO_KMS_SECRET_KEY: my-minio-key:OSMM+vkKUTCvQs9YL/CVMIMt43HFhkUpqJxTmGl6rYw=
run: |
wget --quiet -O /tmp/minio https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x /tmp/minio
mkdir -p /tmp/minio-config/certs/
cp Minio.Functional.Tests/certs/* /tmp/minio-config/certs/
sudo cp /tmp/minio-config/certs/public.crt /etc/ssl/certs/
sudo cp /tmp/minio-config/certs/private.key /etc/ssl/private/
/tmp/minio -C /tmp/minio-config server /tmp/fs{1...4} &
dotnet Minio.Functional.Tests/bin/Release/net7.0/Minio.Functional.Tests.dll
push_to_nuget:
needs: [build, unit_tests, functional_tests, format-check]
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
# Download the Nuget artifacts
- name: Download the Nuget artifacts
uses: actions/download-artifact@v3
with:
name: nuget-packages
path: ./artifacts
# Install .NET
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: "7.0.x"
# Push to NuGet
- name: Push to NuGet
run: dotnet nuget push ./artifacts/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json