-
Notifications
You must be signed in to change notification settings - Fork 6
162 lines (125 loc) · 4.92 KB
/
CI-3x.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
name: CI-3x
on:
push:
branches: [ 3x-dev ]
paths-ignore:
- 'coverage/**'
- '*.md'
- '*.txt'
env:
dotnet-version: 6.0.407
source-url: "https://nuget.pkg.github.com/${{github.repository_owner}}/index.json"
jobs:
build-netcore:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{matrix.os}}
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core for Actual Source
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.dotnet-version }}
- name: Disable local packages feed
run: dotnet nuget disable source "local-packages"
- name: Enable GitHub packages feed
run: dotnet nuget enable source github
- name: Build
run: pwsh ./build.ps1
env:
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
build-windows:
strategy:
fail-fast: false
matrix:
configuration: ['FAKE_XRM_EASY_9', 'FAKE_XRM_EASY_365', 'FAKE_XRM_EASY_2016','FAKE_XRM_EASY_2015','FAKE_XRM_EASY_2013']
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core for Actual Source
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.dotnet-version }}
- name: Disable local packages feed
run: dotnet nuget disable source "local-packages"
- name: Enable GitHub packages feed
run: dotnet nuget enable source github
- name: Build
run: pwsh ./build.ps1 -configuration ${{matrix.configuration}} -targetFrameworks 'all'
env:
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
sonar:
needs: build-netcore
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core for Actual Source
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.dotnet-version }}
- name: Disable local packages feed
run: dotnet nuget disable source "local-packages"
- name: Enable GitHub packages feed
run: dotnet nuget enable source github
- name: Quality Gate
uses: DynamicsValue/dotnet-sonarscanner@v2.4.7
with:
buildCommand: dotnet build . --configuration FAKE_XRM_EASY_9 --framework net6.0
testCommand: dotnet test . --configuration FAKE_XRM_EASY_9 --framework net6.0 --verbosity normal --collect:"XPlat code coverage" --settings tests/.runsettings --results-directory ./coverage
projectKey: ${{ secrets.SONAR_PROJECT_KEY }}
projectName: fake-xrm-easy-plugins
sonarOrganisation: ${{ vars.SONAR_ORG_NAME }}
beginArguments: >
/d:sonar.verbose="true"
/d:sonar.qualitygate.wait="true"
/d:sonar.cs.opencover.reportsPaths='"coverage/**/coverage.opencover.xml"'
/d:sonar.coverage.exclusions='"tests/**/**"'
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
pack-push:
needs: [build-netcore, build-windows, sonar]
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Setup .NET Core for Actual Source
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ env.dotnet-version }}
- name: Disable local packages feed
run: dotnet nuget disable source "local-packages"
- name: Enable GitHub packages feed
run: dotnet nuget enable source github
- name: Build
run: pwsh ./build.ps1 -targetFrameworks 'all'
env:
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
- name: Pack Src
run: pwsh ./pack-src.ps1 -targetFrameworks 'all' -versionSuffix "zci.${{ github.head_ref }}${{ github.run_number }}"
env:
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
- name: Push Src
run: nuget.exe push .\nupkgs\FakeXrmEasy.Plugins.*.nupkg -Source ${{ env.source-url }}
env:
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_AUTH_TOKEN: ${{ github.token }}
NUGET_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Pack Tests
run: pwsh ./pack-tests.ps1 -targetFrameworks 'all' -versionSuffix "zci.${{ github.head_ref }}${{ github.run_number }}"
env:
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
- name: Push Tests
run: nuget.exe push .\nupkgs\FakeXrmEasy.PluginsTests.*.nupkg -Source ${{ env.source-url }}
env:
NUGET_USERNAME: ${{github.repository_owner}}
NUGET_AUTH_TOKEN: ${{ github.token }}
NUGET_TOKEN: ${{ secrets.GITHUB_TOKEN }}