Skip to content

Commit ab60d1c

Browse files
committed
Fix when to run this step!
Add more logging features
1 parent 48dcd52 commit ab60d1c

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

.github/workflows/build-check-install.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ on:
250250
description: |
251251
Should shinytests2 tests only run per modified teal module? If enabled if only there is a module modificated only that shinytest2 file will be tested.
252252
required: false
253-
type: string
253+
type: boolean
254254
default: false
255255

256256
concurrency:
@@ -521,18 +521,31 @@ jobs:
521521
key: additional-caches-${{ runner.os }}
522522

523523
- name: Check only affected modules 🎯
524-
if: ${{ inputs.fast-tests }} == 'true' && github.event_name == 'pull_request'
524+
if: inputs.fast-tests == 'true' && github.event_name == 'pull_request'
525525
run: |
526526
# Set working directory where the git repo is
527527
cd ${{ github.event.repository.name }}/${{ inputs.package-subdirectory }}
528528
529-
test_all=$(git show -s --pretty=%B | grep -F "[run-all-tests]" )
529+
# Exit early if tag is on commit message even if it set to true
530+
test_all=$( git log -1 --pretty=%B | grep -F "[run-all-tests]" )
531+
if [ -z "$test_all" ]
532+
then {
533+
echo "Last commit message forces to test everything."
534+
exit 0
535+
} fi
536+
530537
test_dir="tests/testthat/"
531538
532539
# Get the list of R files that have changed
533540
# https://github.com/cloudnativeto/envoy/blob/de67446fa8af973761bb4716f5143d73643baf8b/.github/workflows/get_build_targets.sh_bak#L9
534541
files=$(git diff --name-only HEAD FETCH_HEAD -- $test_dir R/*.R)
535542
543+
if [ -n "files" ]
544+
then {
545+
echo "No R files affected: test everything."
546+
exit 0
547+
} fi
548+
536549
# Loop through each modified file and determine which tests to run
537550
for file in $files; do
538551

0 commit comments

Comments
 (0)