66 workflow_dispatch :
77 push :
88 branches : [ main, dev, 'feature/*', 'rel/*' ]
9+ paths-ignore :
10+ - changelog.md
11+ - code-of-conduct.md
12+ - security.md
13+ - support.md
914 pull_request :
1015 types : [opened, synchronize, reopened]
1116
@@ -47,20 +52,47 @@ jobs:
4752 fetch-depth : 0
4853
4954 - name : 🙏 build
50- run : dotnet build -m:1 -bl:build.binlog -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER" -p:RepositoryBranch=${GITHUB_REF#refs/*/}
55+ run : dotnet build -m:1 -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
56+
57+ - name : ⚙ GNU grep
58+ if : matrix.os == 'macOS-latest'
59+ run : |
60+ brew install grep
61+ echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> .bash_profile
5162
5263 - 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
64+ shell : bash --noprofile --norc {0}
65+ env :
66+ LC_ALL : en_US.utf8
67+ run : |
68+ [ -f .bash_profile ] && source .bash_profile
69+ counter=0
70+ exitcode=0
71+ reset="\e[0m"
72+ warn="\e[0;33m"
73+ while [ $counter -lt 6 ]
74+ do
75+ if [ $filter ]
76+ then
77+ echo -e "${warn}Retry $counter for $filter ${reset}"
78+ fi
79+ # run test and forward output also to a file in addition to stdout (tee command)
80+ dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m --filter=$filter | tee ./output.log
81+ # capture dotnet test exit status, different from tee
82+ exitcode=${PIPESTATUS[0]}
83+ if [ $exitcode == 0 ]
84+ then
85+ exit 0
86+ fi
87+ # cat output, get failed test names, join as DisplayName=TEST with |, remove trailing |.
88+ filter=$(cat ./output.log | grep -o -P '(?<=\sFailed\s)\w*' | awk 'BEGIN { ORS="|" } { print("DisplayName=" $0) }' | grep -o -P '.*(?=\|$)')
89+ ((counter++))
90+ done
91+ exit $exitcode
5492
5593 - name : 📦 pack
56- run : dotnet pack -m:1 -bl:pack.binlog - p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER" -p:RepositoryBranch=${GITHUB_REF#refs/*/}
94+ run : dotnet pack -m:1 -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
5795
58- - name : 🔼 packages
59- uses : actions/upload-artifact@v2
60- with :
61- name : bin
62- path : bin/*.nupkg
63-
6496 # Only push CI package to sleet feed if building on ubuntu (fastest)
6597 - name : 🚀 sleet
6698 env :
@@ -69,80 +101,3 @@ jobs:
69101 run : |
70102 dotnet tool install -g --version 4.0.18 sleet
71103 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-
73- acceptance :
74- name : acceptance-${{ matrix.os }}
75- runs-on : ${{ matrix.os }}
76- 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- steps :
102- - name : 🤘 checkout
103- uses : actions/checkout@v2
104-
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
142- with :
143- name : bin
144- path : bin
145-
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
0 commit comments