Skip to content

Commit

Permalink
code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NiniOak committed Aug 23, 2023
1 parent e54a110 commit 93d85b3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
32 changes: 16 additions & 16 deletions .github/scripts/filter_changed_files_go_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ trigger_ci=false

# Loop through the changed files and find directories/files outside the skipped ones
for file_to_check in $files_to_check; do
file_is_skipped=false
for dir in "${skipped_directories[@]}"; do
if [[ "$file_to_check" == "$dir"* ]] || [[ "$file_to_check" == *.md && "$dir" == *"/" ]]; then
file_is_skipped=true
break
fi
done
if [ "$file_is_skipped" = "false" ]; then
other_directories+="$(dirname "$file_to_check")\n"
file_is_skipped=false
for dir in "${skipped_directories[@]}"; do
if [[ "$file_to_check" == "$dir"* ]] || [[ "$file_to_check" == *.md && "$dir" == *"/" ]]; then
file_is_skipped=true
break
fi
done
if [ "$file_is_skipped" = "false" ]; then
other_directories+="$(dirname "$file_to_check")\n"
trigger_ci=true
echo "One or more non doc file(s) changed: $trigger_ci"
echo -e $other_directories
echo "trigger-ci=$trigger_ci" >> "$GITHUB_OUTPUT"
exit 0 ## if file is outside of the skipped_directory exit loop
fi
echo "Non doc file(s) changed - skipped ci: $trigger_ci"
echo -e $other_directories
echo "trigger-ci=$trigger_ci" >>"$GITHUB_OUTPUT"
exit 0 ## if file is outside of the skipped_directory exit script
fi
done

echo "One or more non doc file(s) changed: $trigger_ci"
echo "trigger-ci=$trigger_ci" >> "$GITHUB_OUTPUT"
echo "Only doc file(s) changed - skipped ci: $trigger_ci"
echo "trigger-ci=$trigger_ci" >>"$GITHUB_OUTPUT"
6 changes: 3 additions & 3 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-latest
name: Get files changed and conditionally skip CI
outputs:
files-changed: ${{ steps.read-files.outputs.trigger-ci }}
trigger-ci: ${{ steps.read-files.outputs.trigger-ci }}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
Expand All @@ -40,7 +40,7 @@ jobs:
setup:
needs: [conditional-skip]
name: Setup
if: needs.conditional-skip.outputs.files-changed == 'true'
if: needs.conditional-skip.outputs.trigger-ci == 'true'
runs-on: ubuntu-latest
outputs:
compute-small: ${{ steps.setup-outputs.outputs.compute-small }}
Expand Down Expand Up @@ -503,7 +503,7 @@ jobs:
- go-test-32bit
# - go-test-s390x
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
if: always() && needs.conditional-skip.outputs.files-changed == 'true'
if: always() && needs.conditional-skip.outputs.trigger-ci == 'true'
steps:
- name: evaluate upstream job results
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-integrations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: ubuntu-latest
name: Get files changed and conditionally skip CI
outputs:
files-changed: ${{ steps.read-files.outputs.trigger-ci }}
trigger-ci: ${{ steps.read-files.outputs.trigger-ci }}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
Expand All @@ -43,7 +43,7 @@ jobs:
needs: [conditional-skip]
runs-on: ubuntu-latest
name: Setup
if: needs.conditional-skip.outputs.files-changed == 'true'
if: needs.conditional-skip.outputs.trigger-ci == 'true'
outputs:
compute-small: ${{ steps.runners.outputs.compute-small }}
compute-medium: ${{ steps.runners.outputs.compute-medium }}
Expand Down Expand Up @@ -583,7 +583,7 @@ jobs:
- compatibility-integration-test
- peering_commontopo-integration-test
runs-on: ${{ fromJSON(needs.setup.outputs.compute-small) }}
if: always() && needs.conditional-skip.outputs.files-changed == 'true'
if: always() && needs.conditional-skip.outputs.trigger-ci == 'true'
steps:
- name: evaluate upstream job results
run: |
Expand Down

0 comments on commit 93d85b3

Please sign in to comment.