@@ -5,7 +5,13 @@ name: build
5
5
on :
6
6
workflow_dispatch :
7
7
push :
8
- branches : [ main, dev, 'feature/*', 'rel/*' ]
8
+ branches : [ main, dev, 'dev/*', 'feature/*', 'rel/*' ]
9
+ paths-ignore :
10
+ - changelog.md
11
+ - code-of-conduct.md
12
+ - security.md
13
+ - support.md
14
+ - readme.md
9
15
pull_request :
10
16
types : [opened, synchronize, reopened]
11
17
@@ -17,50 +23,57 @@ defaults:
17
23
shell : bash
18
24
19
25
jobs :
20
- dotnet-format :
26
+ os-matrix :
21
27
runs-on : ubuntu-latest
28
+ outputs :
29
+ matrix : ${{ steps.lookup.outputs.matrix }}
22
30
steps :
23
31
- name : 🤘 checkout
24
32
uses : actions/checkout@v2
25
- with :
26
- submodules : recursive
27
- fetch-depth : 0
28
-
29
- - name : ✓ ensure format
33
+
34
+ - name : 🔎 lookup
35
+ id : lookup
36
+ shell : pwsh
30
37
run : |
31
- dotnet tool update -g dotnet-format --version 5.0.*
32
- dotnet restore
33
- dotnet format --check -v:diag
38
+ $path = './.github/workflows/os-matrix.json'
39
+ $os = if (test-path $path) { cat $path } else { '["ubuntu-latest"]' }
40
+ echo "matrix=$os" >> $env:GITHUB_OUTPUT
34
41
35
42
build :
43
+ needs : os-matrix
36
44
name : build-${{ matrix.os }}
37
- needs : dotnet-format
38
45
runs-on : ${{ matrix.os }}
39
46
strategy :
40
47
matrix :
41
- os : [ubuntu-latest, windows-latest, macOS-latest]
48
+ os : ${{ fromJSON(needs.os-matrix.outputs.matrix) }}
42
49
steps :
43
50
- name : 🤘 checkout
44
51
uses : actions/checkout@v2
45
52
with :
46
53
submodules : recursive
47
54
fetch-depth : 0
48
55
56
+ - name : ⚙ dotnet
57
+ uses : actions/setup-dotnet@v1
58
+ if : matrix.os != 'windows-latest'
59
+ with :
60
+ dotnet-version : ' 6.0.x'
61
+
49
62
- name : 🙏 build
50
- run : dotnet build -m:1 -bl:build.binlog -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER" -p:RepositoryBranch=${GITHUB_REF#refs/*/}
63
+ run : dotnet build -m:1 -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
64
+
65
+ - name : ⚙ GNU grep
66
+ if : matrix.os == 'macOS-latest'
67
+ run : |
68
+ brew install grep
69
+ echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> .bash_profile
51
70
52
71
- name : 🧪 test
53
- run : dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m -d $GITHUB_WORKSPACE/logs/${{ matrix.os }}.txt -r $GITHUB_WORKSPACE/logs
72
+ uses : ./.github/workflows/test
54
73
55
74
- name : 📦 pack
56
- run : dotnet pack -m:1 -bl:pack.binlog - p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER" -p:RepositoryBranch=${GITHUB_REF#refs/*/}
75
+ run : dotnet pack -m:1 -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
57
76
58
- - name : 🔼 packages
59
- uses : actions/upload-artifact@v2
60
- with :
61
- name : bin
62
- path : bin/*.nupkg
63
-
64
77
# Only push CI package to sleet feed if building on ubuntu (fastest)
65
78
- name : 🚀 sleet
66
79
env :
@@ -70,79 +83,20 @@ jobs:
70
83
dotnet tool install -g --version 4.0.18 sleet
71
84
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found"
72
85
73
- acceptance :
74
- name : acceptance-${{ matrix.os }}
75
- runs-on : ${{ matrix.os }}
86
+ dotnet-format :
87
+ runs-on : ubuntu-latest
76
88
needs : build
77
- strategy :
78
- matrix :
79
- os : [ubuntu-latest, windows-latest, macOS-latest]
80
- steps :
81
- - name : 🤘 checkout
82
- uses : actions/checkout@v2
83
-
84
- - name : 🔽 packages
85
- uses : actions/download-artifact@v2
86
- with :
87
- name : bin
88
- path : bin
89
-
90
- - name : 🧪 test
91
- run : dotnet test -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
92
- working-directory : src/Acceptance
93
-
94
- preview :
95
- defaults :
96
- run :
97
- shell : pwsh
98
- needs : dotnet-format
99
- runs-on : windows-latest
100
-
101
89
steps :
102
90
- name : 🤘 checkout
103
91
uses : actions/checkout@v2
92
+ with :
93
+ submodules : recursive
94
+ fetch-depth : 0
104
95
105
- # > VS Preview
106
- - name : 🔽 dotnet-vs
107
- run : dotnet tool update -g dotnet-vs
108
- - name : 🔽 vs preview
109
- run : vs install preview --quiet +Microsoft.VisualStudio.Component.ManagedDesktop.Core +Microsoft.NetCore.Component.DevelopmentTools
110
- - name : ≥ msbuild
111
- run : echo "$(vs where preview --prop=InstallationPath)\MSBuild\Current\Bin" >> $env:GITHUB_PATH
112
- # < VS Preview
113
-
114
- - name : ⚙ curl
115
- run : |
116
- iwr -useb get.scoop.sh | iex
117
- scoop install curl
118
- - name : 🔍 status for PR
119
- if : ${{ github.event.pull_request.head.sha }}
120
- run : echo "STATUS_SHA=${{ github.event.pull_request.head.sha }}" >> $env:GITHUB_ENV
121
-
122
- - name : 🔍 status for branch
123
- if : ${{ !github.event.pull_request.head.sha }}
124
- run : echo "STATUS_SHA=$($env:GITHUB_SHA)" >> $env:GITHUB_ENV
125
-
126
- - name : ⌛ wait on build
127
- env :
128
- CHECK : build-windows-latest
129
- SHA : ${{ env.STATUS_SHA }}
130
- TOKEN : ${{ secrets.GITHUB_TOKEN }}
131
- run : ./.github/workflows/wait-status.ps1
132
-
133
- - name : ⌛ wait on acceptance
134
- env :
135
- CHECK : acceptance-windows-latest
136
- SHA : ${{ env.STATUS_SHA }}
137
- TOKEN : ${{ secrets.GITHUB_TOKEN }}
138
- run : ./.github/workflows/wait-status.ps1
139
-
140
- - name : 🔽 packages
141
- uses : actions/download-artifact@v2
96
+ - name : ⚙ dotnet
97
+ uses : actions/setup-dotnet@v1
142
98
with :
143
- name : bin
144
- path : bin
99
+ dotnet-version : ' 6.0.x'
145
100
146
- - name : 🧪 test
147
- run : msbuild -r -t:build,test -p:TargetFramework=net472 -p:VersionLabel="$($env:GITHUB_REF).$($env:GITHUB_RUN_NUMBER)"
148
- working-directory : src/Acceptance
101
+ - name : ✓ ensure format
102
+ run : dotnet format --verify-no-changes -v:diag --exclude ~/.nuget
0 commit comments