forked from EasyNetQ/EasyNetQ
-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.92 KB
/
ci.yml
File metadata and controls
97 lines (83 loc) · 2.92 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
name: CI
on:
push:
branches:
- master
- '[0-9]+.x'
tags: [ '[0-9]+.[0-9]+.[0-9]+*' ]
pull_request:
branches:
- master
- develop
permissions:
contents: read
jobs:
test:
name: Lint & Test
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
matrix:
dotnet: ['7.*']
fail-fast: true
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core ${{ matrix.dotnet }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ matrix.dotnet }}
- name: Install dependencies
run: dotnet restore ${{ github.workspace }}/Source/EasyNetQ.sln
- name: Check formatting
run: dotnet format --no-restore --verify-no-changes --severity warn ./Source/EasyNetQ.sln || (echo "Run 'dotnet format' to fix issues" && exit 1)
- name: Build
run: dotnet build ${{ github.workspace }}/Source/EasyNetQ.sln --configuration Release
- name: Tests
run: |
cd ${{ github.workspace }}/Source/EasyNetQ.Tests
dotnet test --configuration Release --no-build
- name: DI.Tests
run: |
cd ${{ github.workspace }}/Source/EasyNetQ.DI.Tests
dotnet test --configuration Release --no-build
- name: Serialization.Tests
run: |
cd ${{ github.workspace }}/Source/EasyNetQ.Serialization.Tests
dotnet test --configuration Release --no-build
- name: Hosepipe.Tests
run: |
cd ${{ github.workspace }}/Source/EasyNetQ.Hosepipe.Tests
dotnet test --configuration Release --no-build --filter "(Category!=Explicit)"
- name: Integration Tests
run: |
cd ${{ github.workspace }}/Source/EasyNetQ.IntegrationTests
dotnet test --configuration Release --no-build
- name: Approval Tests
run: |
cd ${{ github.workspace }}/Source/EasyNetQ.ApprovalTests
dotnet test --configuration Release --no-build
publish-to-nuget:
name: Publish to NuGet
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET Core ${{ matrix.dotnet }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.*'
- name: Install dependencies
run: dotnet restore ${{ github.workspace }}/Source/EasyNetQ.sln
- name: Build
run: dotnet build ${{ github.workspace }}/Source/EasyNetQ.sln --configuration Release
- name: Pack
run: dotnet pack ${{ github.workspace }}/Source/EasyNetQ.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 }}