diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6476ce2f7..fe124e93d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -40,8 +40,9 @@ jobs: echo "Diffing against $base_ref:" changed_files="$(git diff "$base_ref" --name-only || true)" - - packages=$( + + # Collect candidate package paths from diff + candidates=$( printf '%s\n' "$changed_files" \ | awk -F'/' ' /^functions\/src\// {print $1"/"$2"/"$3} @@ -50,6 +51,14 @@ jobs: | sort -u ) + # Keep only those that are actual directories + packages="" + for dir in $candidates; do + if [[ -d "$dir" ]]; then + packages+="$dir"$'\n' + fi + done + if [[ -z "$packages" ]]; then matrix_json='{"package":[]}' else @@ -78,6 +87,7 @@ jobs: run_monorepo_tests: needs: build_strategy_matrix + if: needs.build_strategy_matrix.outputs.matrix != '{"package":[]}' runs-on: ubuntu-latest strategy: # matrix: [{"package": some package that changed}, {...}, ...] diff --git a/.github/workflows/test-all.yaml b/.github/workflows/test-all.yaml index 7594087d4..e53f9d2dd 100644 --- a/.github/workflows/test-all.yaml +++ b/.github/workflows/test-all.yaml @@ -34,14 +34,23 @@ jobs: # This is old fetch command it cant work cause base_ref is only avaliable on pull request actions: git fetch origin ${{ github.base_ref }}:${{ github.base_ref }} run: | all_files="$(git ls-files || true)" - packages=$( - printf '%s\n' "$all_files" \ + # Collect candidate package paths from diff + candidates=$( + printf '%s\n' "$changed_files" \ | awk -F'/' ' /^functions\/src\// {print $1"/"$2"/"$3} /^modules\/src\// {print $1"/"$2"/"$3} ' \ | sort -u ) + + # Keep only those that are actual directories + packages="" + for dir in $candidates; do + if [[ -d "$dir" ]]; then + packages+="$dir"$'\n' + fi + done if [[ -z "$packages" ]]; then matrix_json='{"package":[]}' diff --git a/.gitignore b/.gitignore index f00b38d9e..4637ce406 100644 --- a/.gitignore +++ b/.gitignore @@ -140,3 +140,4 @@ dmypy.json .pyre/ conda-setup-cpu conda-setup-gpu +.DS_Store diff --git a/modules/src/.gitkeep b/modules/src/.gitkeep new file mode 100644 index 000000000..e69de29bb