diff --git a/.github/workflows/samples.yml b/.github/workflows/samples.yml index 8acfbd3e..a25176ad 100644 --- a/.github/workflows/samples.yml +++ b/.github/workflows/samples.yml @@ -36,13 +36,6 @@ jobs: run: dotnet build -m:1 -bl:build.binlog working-directory: samples/dotnet - - name: โš™ GNU grep - if: matrix.os == 'macOS-latest' - working-directory: samples/dotnet - run: | - brew install grep - echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> .bash_profile - - name: ๐Ÿงช test uses: ./.github/workflows/test with: diff --git a/.github/workflows/test/action.yml b/.github/workflows/test/action.yml index 83ee6a1f..dd974837 100644 --- a/.github/workflows/test/action.yml +++ b/.github/workflows/test/action.yml @@ -9,14 +9,26 @@ inputs: runs: using: "composite" steps: + - name: โš™ GNU grep + shell: bash + if: runner.os == 'macOS' + working-directory: samples/dotnet + run: brew install grep + + - name: โš™ GNU alias + shell: bash + if: runner.os != 'macOS' + working-directory: samples/dotnet + run: echo "alias ggrep='grep'" >> ~/.bashrc + - name: ๐Ÿงช test - shell: bash --noprofile --norc {0} + shell: bash env: LC_ALL: en_US.utf8 working-directory: ${{ inputs.working-directory }} run: | - [ -f .bash_profile ] && source .bash_profile - grep -V + [ -f ~/.bashrc ] && source ~/.bashrc + ggrep -V counter=0 exitcode=0 reset="\e[0m" @@ -38,7 +50,7 @@ runs: exit 0 fi # cat output, get failed test names, remove trailing whitespace, sort+dedupe, join as FQN~TEST with |, remove trailing |. - filter=$(cat ./output.log | grep -o -P '(?<=\sFailed\s)[\w\._]*' | sed 's/ *$//g' | sort -u | awk 'BEGIN { ORS="|" } { print("FullyQualifiedName~" $0) }' | grep -o -P '.*(?=\|$)') + filter=$(cat ./output.log | ggrep -o -P '(?<=\sFailed\s)[\w\._]*' | sed 's/ *$//g' | sort -u | awk 'BEGIN { ORS="|" } { print("FullyQualifiedName~" $0) }' | ggrep -o -P '.*(?=\|$)') ((counter++)) done exit $exitcode