-
Notifications
You must be signed in to change notification settings - Fork 83
130 lines (124 loc) · 4.39 KB
/
ci.yml
File metadata and controls
130 lines (124 loc) · 4.39 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
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
name: CI
on:
push:
branches:
- master
tags: [ 'v[0-9]+.[0-9]+.[0-9]+*' ]
pull_request:
branches:
- master
permissions:
contents: read
jobs:
lint-and-approval-tests:
name: Lint & Approval Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET Core 8.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
- name: Install dependencies
run: dotnet restore ${{ github.workspace }}/Source/EasyNetQ.Management.Client.sln
- name: Check formatting
run: dotnet format --no-restore --verify-no-changes --severity warn ./Source/EasyNetQ.Management.Client.sln || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Build
run: dotnet build ${{ github.workspace }}/Source/EasyNetQ.Management.Client.sln --configuration Release
- name: Approval Tests
run: |
cd ${{ github.workspace }}/Source/EasyNetQ.Management.Client.ApprovalTests
dotnet test --configuration Release --no-build
unit-tests:
name: Unit Tests
runs-on: ${{ matrix.os }}
needs: lint-and-approval-tests
timeout-minutes: 15
strategy:
max-parallel: 3
matrix:
include:
- os: ubuntu-latest
framework: net8.0
- os: windows-latest
framework: net48
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET Core 8.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
- name: Install dependencies
run: dotnet restore ${{ github.workspace }}/Source/EasyNetQ.Management.Client.sln
- name: Build
run: dotnet build ${{ github.workspace }}/Source/EasyNetQ.Management.Client.sln --configuration Release
- name: Tests
run: |
cd ${{ github.workspace }}/Source/EasyNetQ.Management.Client.Tests
dotnet test --configuration Release --framework ${{ matrix.framework }} --no-build
integration-tests:
name: Integrations Tests
runs-on: ${{ matrix.os }}
needs: lint-and-approval-tests
timeout-minutes: 15
strategy:
max-parallel: 6
matrix:
rabbitmq: ['3.12', '3.13', '4.0']
# os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
include:
- os: ubuntu-latest
framework: net8.0
# - os: windows-latest
# framework: net48
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET Core 8.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
- name: Install dependencies
run: dotnet restore ${{ github.workspace }}/Source/EasyNetQ.Management.Client.sln
- name: Build
run: dotnet build ${{ github.workspace }}/Source/EasyNetQ.Management.Client.sln --configuration Release
- name: Integration Tests
env:
RABBITMQ_VERSION: ${{ matrix.rabbitmq }}
run: |
cd ${{ github.workspace }}/Source/EasyNetQ.Management.Client.IntegrationTests
dotnet test --configuration Release --framework ${{ matrix.framework }} --no-build
publish-to-nuget:
name: Publish to NuGet
runs-on: ubuntu-latest
needs: [lint-and-approval-tests, unit-tests, integration-tests]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Setup .NET Core 8.x
uses: actions/setup-dotnet@v5
with:
dotnet-version: 8.x
- name: Install dependencies
run: dotnet restore ${{ github.workspace }}/Source/EasyNetQ.Management.Client.sln
- name: Build
run: dotnet build ${{ github.workspace }}/Source/EasyNetQ.Management.Client.sln --configuration Release
- name: Pack
run: dotnet pack ${{ github.workspace }}/Source/EasyNetQ.Management.Client.sln --configuration Release --no-build --include-symbols -p:PackageOutputPath="${{ github.workspace }}/Packages"
- name: Publish
run: dotnet nuget push '${{ github.workspace }}/Packages/*.*' --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_TOKEN }}