Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleted duplicated tabular tools #551

Merged
merged 9 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 47 additions & 22 deletions .github/workflows/package-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ on:
list:
description: "The list of directories containing the updated packages"
value: ${{ jobs.package-filter.outputs.list }}
num_packages:
description: "The number of updated packages"
value: ${{ jobs.package-filter.outputs.num_packages }}

permissions:
contents: read
Expand All @@ -31,6 +34,7 @@ jobs:
outputs:
matrix: ${{ steps.package-filter.outputs.matrix }}
list: ${{ steps.package-filter.outputs.list }}
num_packages: ${{ steps.package-filter.outputs.num_packages }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -41,6 +45,7 @@ jobs:
- name: Find Updated Packages
id: package-filter
run: |
NUM_PACKAGES=0
PACKAGE_DIRS=""
COMPANION_FILES="VERSION .bumpversion.cfg"

Expand All @@ -63,7 +68,17 @@ jobs:
echo "The comparison point is ${comparison_point}"

# Get the changed files
changed_files=$(git diff --name-only ${comparison_point}...)
# the `--diff-filter=ACMR` flag filters out deleted files. The filters are as follows:
# A: Added
# C: Copied
# M: Modified
# R: Renamed
# D: Deleted
# T: Type changed (for example, regular file or symlink or submodule)
# U: Unmerged
# X: Unknown
# B: Broken pairing
changed_files=$(git diff --diff-filter=ACMR --name-only ${comparison_point}...)
# echo the changed files
echo "The changed files are $changed_files"

Expand Down Expand Up @@ -113,6 +128,7 @@ jobs:
fi
fi

NUM_PACKAGES=$((NUM_PACKAGES+1))
PACKAGE_DIRS="$PACKAGE_DIRS ${pkg_dir}"
fi
done
Expand All @@ -124,29 +140,38 @@ jobs:
echo "The updated packages are $PACKAGE_DIRS"
if [ -z "$PACKAGE_DIRS" ]
then
echo "::error::No updated packages were found" && exit 1
fi
echo "::warning::No updated packages were found"

# Convert the package directories to JSON for the output matrix
JSON="{\"include\": ["
for package_dir in $PACKAGE_DIRS
do
package_name=$(basename $package_dir)
JSON_LINE="{\"package_dir\": \"${package_dir}\", \"package_name\": \"${package_name}\"},"
# Add the JSON line to the JSON string if it is not already included
if [ ! "$JSON" == *"$JSON_LINE"* ]
echo "matrix={\"include\": []}" >> $GITHUB_OUTPUT
echo "list=" >> $GITHUB_OUTPUT
echo "num_packages=0" >> $GITHUB_OUTPUT

else
echo "The number of updated packages is $NUM_PACKAGES"

# Convert the package directories to JSON for the output matrix
JSON="{\"include\": ["
for package_dir in $PACKAGE_DIRS
do
package_name=$(basename $package_dir)
JSON_LINE="{\"package_dir\": \"${package_dir}\", \"package_name\": \"${package_name}\"},"
# Add the JSON line to the JSON string if it is not already included
if [ ! "$JSON" == *"$JSON_LINE"* ]
then
JSON="$JSON$JSON_LINE"
fi
done

# Remove trailing comma and add closing brackets
if [ "$JSON" == *"," ]
then
JSON="$JSON$JSON_LINE"
JSON="${JSON%?}"
fi
done
JSON="$JSON]}"

# Remove trailing comma and add closing brackets
if [ "$JSON" == *"," ]
then
JSON="${JSON%?}"
fi
JSON="$JSON]}"
# Set the output
echo "matrix=$( echo "$JSON" )" >> $GITHUB_OUTPUT
echo "list=$( echo "$PACKAGE_DIRS" )" >> $GITHUB_OUTPUT
echo "num_packages=$NUM_PACKAGES" >> $GITHUB_OUTPUT

# Set the output
echo "matrix=$( echo "$JSON" )" >> $GITHUB_OUTPUT
echo "list=$( echo "$PACKAGE_DIRS" )" >> $GITHUB_OUTPUT
fi
3 changes: 3 additions & 0 deletions .github/workflows/package-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
pre-commit:
name: Pre-commit | ${{ matrix.package_name }}
needs: package-filter
if: ${{ needs.package-filter.outputs.num_packages > 0 }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.package-filter.outputs.matrix) }}
Expand Down Expand Up @@ -56,6 +57,7 @@ jobs:
docker:
name: Docker | Build ${{ matrix.package_name }}
needs: package-filter
if: ${{ needs.package-filter.outputs.num_packages > 0 }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.package-filter.outputs.matrix) }}
Expand Down Expand Up @@ -106,6 +108,7 @@ jobs:
tests:
name: Test | ${{ matrix.package_name }}
needs: package-filter
if: ${{ needs.package-filter.outputs.num_packages > 0 }}
strategy:
fail-fast: false
matrix: ${{ fromJson(needs.package-filter.outputs.matrix) }}
Expand Down
30 changes: 0 additions & 30 deletions clustering/K-NN/Distributed-Memory/Dockerfile-Distributed

This file was deleted.

Loading
Loading