Skip to content

Commit

Permalink
code review feedback: kick CI
Browse files Browse the repository at this point in the history
  • Loading branch information
NiniOak committed Aug 22, 2023
1 parent 11febbd commit 5f5bc39
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 41 deletions.
34 changes: 0 additions & 34 deletions .github/scripts/changed_files.sh

This file was deleted.

33 changes: 33 additions & 0 deletions .github/scripts/filter_changed_files_go_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

# Get the list of changed files
files_to_check=$(git diff --name-only origin/$GITHUB_BASE_REF)

# Define the directories to check
skipped_directories=("docs/" "ui/" "website/" "grafana/" ".github/")

# Initialize a variable to track directories outside the skipped ones
other_directories=""
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"
trigger_ci=true
echo "One or more non doc file(s) changed: true"
echo -e $other_directories
echo "trigger-ci=$trigger_ci" >> "$GITHUB_OUTPUT"
exit 0 ## if file is outside of the skipped_directory exit loop
fi
done

echo "One or more non doc file(s) changed: false"
echo "trigger-ci=$trigger_ci" >> "$GITHUB_OUTPUT"
8 changes: 4 additions & 4 deletions .github/workflows/go-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ env:
jobs:
conditional-skip:
runs-on: ubuntu-latest
name: Get files changed and condtionally skip CI
name: Get files changed and conditionally skip CI
outputs:
files-changed: ${{ steps.read-files.outputs.trigger-ci }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
- name: Get all docs, ui and github files that have changed
- name: Get changed files
id: read-files
run: ./.github/scripts/changed_files.sh
run: ./.github/scripts/filter_changed_files_go_test.sh

setup:
needs: [conditional-skip]
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 @@ -32,12 +32,12 @@ jobs:
outputs:
files-changed: ${{ steps.read-files.outputs.trigger-ci }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
with:
fetch-depth: 0
- name: Get all docs, ui and github files that have changed
- name: Get changed files
id: read-files
run: ./.github/scripts/changed_files.sh
run: ./.github/scripts/filter_changed_files_go_test.sh

setup:
needs: [conditional-skip]
Expand Down
1 change: 1 addition & 0 deletions test-integ/peering_commontopo/ac1_basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
)

type ac1BasicSuite struct {
// test comment
// inputs
DC string
Peer string
Expand Down

0 comments on commit 5f5bc39

Please sign in to comment.