Skip to content

Commit

Permalink
Use ggrep for macos run
Browse files Browse the repository at this point in the history
  • Loading branch information
howard-e committed Dec 5, 2024
1 parent 4fa7d7d commit bfde660
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/regression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ jobs:

- name: Set up firefox for macos
if: matrix.os == 'macos-latest'
run: brew install firefox
run: |
brew install firefox
# Install GNU grep to use 'grep -P'
brew install grep
echo "/opt/homebrew/opt/grep/libexec/gnubin" >> $GITHUB_PATH
- name: Set up Node.js
uses: actions/setup-node@v4
Expand Down
10 changes: 5 additions & 5 deletions scripts/regression-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ fi
AVACMD="npm run regression -- -t"
ARGS=''

TEST_FILES=$(git diff --name-only $COMMIT_RANGE | perl -nle'print $& while m{test/tests/\K.*}g' | uniq)
TEST_INFRA=$(git diff --name-only $COMMIT_RANGE | perl -nle'print $& while m{test/(util|index)}g')
TEST_FILES=$(git diff --name-only $COMMIT_RANGE | grep -oP 'test/tests/\K.*' | uniq)
TEST_INFRA=$(git diff --name-only $COMMIT_RANGE | grep -oP 'test/(util|index)')

EXAMPLE_DIRS=$(git diff --name-only $COMMIT_RANGE | perl -nle'print $& while m{examples/\K[\w-]+(?=/)}g' | uniq)
EXAMPLE_INFRA=$(echo "$EXAMPLE_DIRS" | perl -nle'print if m{^(js|css)$}')
EXAMPLE_DIRS=$(git diff --name-only $COMMIT_RANGE | grep -oP 'examples/\K[\w-]+(?=/)' | uniq)
EXAMPLE_INFRA=$(echo "$EXAMPLE_DIRS" | grep -P '^(js|css)$')

PACKAGE_UPDATE=$(git diff --name-only $COMMIT_RANGE | perl -nle'print if m{package(-lock)?\.json}')
PACKAGE_UPDATE=$(git diff --name-only $COMMIT_RANGE | grep -P 'package(-lock)?\.json')

if [[ $TEST_INFRA || $EXAMPLE_INFRA || $PACKAGE_UPDATE ]]
then
Expand Down

0 comments on commit bfde660

Please sign in to comment.