Skip to content

Commit

Permalink
test: shallowClone in checkstyle-tester with SHA checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
piyush kumar sadangi authored and romani committed May 8, 2024
1 parent 5071019 commit c6ba468
Showing 1 changed file with 31 additions and 4 deletions.
35 changes: 31 additions & 4 deletions .ci/validation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -889,12 +889,26 @@ no-exception-struts)
CS_POM_VERSION="$(getCheckstylePomVersion)"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo CS_version: "${CS_POM_VERSION}"
checkout_from https://github.com/checkstyle/contribution
cd .ci-temp/contribution/checkstyle-tester
checkout_from https://github.com/relentless-pursuit/contribution
cd .ci-temp/contribution
echo "Current directory: $(pwd)"
echo "Current branch: $(git rev-parse --abbrev-ref HEAD)"
echo "Fetching remote branches..."
git fetch origin
echo "Available remote branches:"
git branch -r
echo "Fetching shallowClone branch..."
git fetch origin refs/heads/shallowClone:refs/remotes/origin/shallowClone
echo "Checking out shallowClone branch..."
git checkout shallowClone
echo "Current branch after checkout: $(git rev-parse --abbrev-ref HEAD)"
cd checkstyle-tester
echo "Current directory: $(pwd)"
sed -i'' 's/^guava/#guava/' projects-to-test-on.properties
sed -i'' 's/#apache-struts/apache-struts/' projects-to-test-on.properties
groovy ./diff.groovy --listOfProjects projects-to-test-on.properties \
--patchConfig checks-nonjavadoc-error.xml -p "$BRANCH" -r ../../.. \
--useShallowClone \
--allowExcludes --mode single -xm "-Dcheckstyle.failsOnError=false"
cd ../../
removeFolderWithProtectedFiles contribution
Expand Down Expand Up @@ -1030,8 +1044,21 @@ no-exception-Pmd-elasticsearch-lombok-ast)
CS_POM_VERSION="$(getCheckstylePomVersion)"
BRANCH=$(git rev-parse --abbrev-ref HEAD)
echo CS_version: "${CS_POM_VERSION}"
checkout_from https://github.com/checkstyle/contribution
cd .ci-temp/contribution/checkstyle-tester
checkout_from https://github.com/relentless-pursuit/contribution
cd .ci-temp/contribution
echo "Current directory: $(pwd)"
echo "Current branch: $(git rev-parse --abbrev-ref HEAD)"
echo "Fetching remote branches..."
git fetch origin
echo "Available remote branches:"
git branch -r
echo "Fetching shallowClone branch..."
git fetch origin refs/heads/shallowClone:refs/remotes/origin/shallowClone
echo "Checking out shallowClone branch..."
git checkout shallowClone
echo "Current branch after checkout: $(git rev-parse --abbrev-ref HEAD)"
cd checkstyle-tester
echo "Current directory: $(pwd)"
sed -i.'' 's/^guava/#guava/' projects-to-test-on.properties
sed -i.'' 's/#pmd/pmd/' projects-to-test-on.properties
sed -i.'' 's/#elasticsearch/elasticsearch/' projects-to-test-on.properties
Expand Down

0 comments on commit c6ba468

Please sign in to comment.