Skip to content

Commit

Permalink
Issue checkstyle#10188: Migrate Pitest to Actions and others to CircleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
AkMo3 authored and romani committed Aug 11, 2021
1 parent 5dbf18e commit 1733cd4
Show file tree
Hide file tree
Showing 4 changed files with 669 additions and 353 deletions.
10 changes: 9 additions & 1 deletion .ci/pitest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ pitest-annotation|pitest-design \
|pitest-packagenamesloader \
|pitest-common-2|pitest-misc|pitest-xpath \
|pitest-filters \
|pitest-main \
|pitest-coding \
|pitest-regexp \
|pitest-meta \
Expand All @@ -48,6 +47,15 @@ pitest-annotation|pitest-design \
checkPitestReport "${ignoredItems[@]}"
;;

# till #9351
pitest-main)
mvn -e -P$1 clean test org.pitest:pitest-maven:mutationCoverage;
declare -a ignoredItems=(
"Main.java.html:<td class='uncovered'><pre><span class=''> }</span></pre></td></tr>"
);
checkPitestReport "${ignoredItems[@]}"
;;

pitest-header)
mvn -e -P$1 clean test org.pitest:pitest-maven:mutationCoverage;
declare -a ignoredItems=(
Expand Down
286 changes: 30 additions & 256 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,278 +1,52 @@
version: 2
jobs:

build-caches:
machine: true
no-exception-lucene-and-others-javadoc:
docker:
- image: checkstyle/jdk-8-groovy-git-mvn:1.8.0_282-3.0.8-2.25.1-3.6.3
steps:
# restore_cache.keys does not work, so multiple restore_cache.key is used
- restore_cache:
key: m2-cache
- checkout
- run:
name: run_job creation
command: |
mkdir -p .ci-temp
SKIP_FILES1=".github|appveyor.yml|.travis.yml|\.ci/"
SKIP_FILES2="|fast-forward-merge.sh"
SKIP_FILES3="|LICENSE|LICENSE.apache20|README.md|release.sh"
SKIP_FILES4="|RIGHTS.antlr|codeship"
SKIP_FILES5="|wercker.yml|wercker.sh"
SKIP_FILES6="|intellij-idea-inspections.xml"
SKIP_FILES7="|org.eclipse.jdt.core.prefs"
FULL_SKIP1=$SKIP_FILES1$SKIP_FILES2$SKIP_FILES3$SKIP_FILES4
FULL_SKIP2=$SKIP_FILES5$SKIP_FILES6$SKIP_FILES7
SKIP_FILES=$FULL_SKIP1$FULL_SKIP2
export RUN_JOB=1
# source ./.ci/common.sh
# should_run_job will change RUN_JOB variable
# should_run_job "recheck" $SKIP_FILES
echo $RUN_JOB > .ci-temp/run_job
- run:
name: download all maven dependencies and groovy
command: |
RUN_JOB=`cat .ci-temp/run_job`
echo "RUN_JOB="$RUN_JOB
if [[ $RUN_JOB == 1 ]]; then
pwd
ls -la
java -version
mvn --version
mvn -e -Ppitest-metrics dependency:go-offline
else
echo "build is skipped ..."
fi
- run:
name: download all maven dependencies and groovy (second try)
command: |
RUN_JOB=`cat .ci-temp/run_job`
echo "RUN_JOB="$RUN_JOB
if [[ $RUN_JOB == 1 ]]; then
mvn -e -Ppitest-metrics dependency:go-offline
else
echo "build is skipped ..."
fi
when: on_fail
- persist_to_workspace:
root: /home/circleci/
paths:
- .m2
- project
- contribution

pitest1:
machine: true
parallelism: 4
./.ci/no-exception-test.sh no-exception-lucene-and-others-javadoc
no-exception-cassandra-storm-tapestry-javadoc:
docker:
- image: checkstyle/jdk-8-groovy-git-mvn:1.8.0_282-3.0.8-2.25.1-3.6.3
steps:
- attach_workspace:
at: /home/circleci/
- run:
command: |
RUN_JOB=`cat .ci-temp/run_job`
echo "RUN_JOB="$RUN_JOB
if [[ $RUN_JOB == 1 ]]; then
echo "./.ci/pitest.sh pitest-coding" >> commands.txt
echo "./.ci/pitest.sh pitest-common" >> commands.txt
echo "./.ci/pitest.sh pitest-imports" >> commands.txt
echo "./.ci/pitest.sh pitest-ant" >> commands.txt
CMD="$(circleci tests split commands.txt)"
echo "Command: $CMD"
eval $CMD
else
echo "build is skipped ..."
fi
- store_artifacts:
path: ./target/pit-reports

pitest2:
machine: true
parallelism: 4
steps:
- attach_workspace:
at: /home/circleci/
- run:
command: |
RUN_JOB=`cat .ci-temp/run_job`
echo "RUN_JOB="$RUN_JOB
if [[ $RUN_JOB == 1 ]]; then
echo "./.ci/pitest.sh pitest-main" >> commands.txt
echo "./.ci/pitest.sh pitest-javadoc" >> commands.txt
echo "./.ci/pitest.sh pitest-indentation" >> commands.txt
echo "./.ci/pitest.sh pitest-xpath" >> commands.txt
CMD="$(circleci tests split commands.txt)"
echo "Command: $CMD"
eval $CMD
else
echo "build is skipped ..."
fi
- store_artifacts:
path: ./target/pit-reports

pitest3:
machine: true
parallelism: 4
steps:
- attach_workspace:
at: /home/circleci/
- run:
command: |
RUN_JOB=`cat .ci-temp/run_job`
echo "RUN_JOB="$RUN_JOB
if [[ $RUN_JOB == 1 ]]; then
echo "./.ci/pitest.sh pitest-misc" >> commands.txt
echo "./.ci/pitest.sh pitest-design" >> commands.txt
echo "./.ci/pitest.sh pitest-api" >> commands.txt
echo "./.ci/pitest.sh pitest-utils" >> commands.txt
CMD="$(circleci tests split commands.txt)"
echo "Command: $CMD"
eval $CMD
else
echo "build is skipped ..."
fi
- store_artifacts:
path: ./target/pit-reports

pitest4:
machine: true
parallelism: 4
steps:
- attach_workspace:
at: /home/circleci/
- run:
command: |
RUN_JOB=`cat .ci-temp/run_job`
echo "RUN_JOB="$RUN_JOB
if [[ $RUN_JOB == 1 ]]; then
echo "./.ci/pitest.sh pitest-whitespace" >> commands.txt
echo "./.ci/pitest.sh pitest-filters" >> commands.txt
echo "./.ci/pitest.sh pitest-header" >> commands.txt
echo "./.ci/pitest.sh pitest-annotation" >> commands.txt
CMD="$(circleci tests split commands.txt)"
echo "Command: $CMD"
eval $CMD
else
echo "build is skipped ..."
fi
- store_artifacts:
path: ./target/pit-reports

pitest5:
machine: true
parallelism: 4
steps:
- attach_workspace:
at: /home/circleci/
- checkout
- run:
command: |
RUN_JOB=`cat .ci-temp/run_job`
echo "RUN_JOB="$RUN_JOB
if [[ $RUN_JOB == 1 ]]; then
echo "./.ci/pitest.sh pitest-packagenamesloader" >> commands.txt
echo "./.ci/pitest.sh pitest-tree-walker" >> commands.txt
echo "./.ci/pitest.sh pitest-naming" >> commands.txt
echo "./.ci/pitest.sh pitest-metrics" >> commands.txt
CMD="$(circleci tests split commands.txt)"
echo "Command: $CMD"
eval $CMD
else
echo "build is skipped ..."
fi
- store_artifacts:
path: ./target/pit-reports

pitest6:
machine: true
parallelism: 4
./.ci/no-exception-test.sh no-exception-cassandra-storm-tapestry-javadoc
no-exception-hadoop-apache-groovy-scouter-javadoc:
docker:
- image: checkstyle/jdk-8-groovy-git-mvn:1.8.0_282-3.0.8-2.25.1-3.6.3
steps:
- attach_workspace:
at: /home/circleci/
- checkout
- run:
command: |
RUN_JOB=`cat .ci-temp/run_job`
echo "RUN_JOB="$RUN_JOB
if [[ $RUN_JOB == 1 ]]; then
echo "./.ci/pitest.sh pitest-blocks" >> commands.txt
echo "./.ci/pitest.sh pitest-sizes" >> commands.txt
echo "./.ci/pitest.sh pitest-modifier" >> commands.txt
echo "./.ci/pitest.sh pitest-regexp" >> commands.txt
CMD="$(circleci tests split commands.txt)"
echo "Command: $CMD"
eval $CMD
else
echo "build is skipped ..."
fi
- store_artifacts:
path: ./target/pit-reports

pitest7:
machine: true
parallelism: 4
./.ci/no-exception-test.sh no-exception-hadoop-apache-groovy-scouter-javadoc
no-exception-only-javadoc:
docker:
- image: checkstyle/jdk-8-groovy-git-mvn:1.8.0_282-3.0.8-2.25.1-3.6.3
steps:
- attach_workspace:
at: /home/circleci/
- checkout
- run:
command: |
RUN_JOB=`cat .ci-temp/run_job`
echo "RUN_JOB="$RUN_JOB
if [[ $RUN_JOB == 1 ]]; then
echo "./.ci/pitest.sh pitest-gui" >> commands.txt
# echo "./.ci/pitest.sh pitest-meta" >> commands.txt
CMD="$(circleci tests split commands.txt)"
echo "Command: $CMD"
eval $CMD
else
echo "build is skipped ..."
fi
- store_artifacts:
path: ./target/pit-reports

pitest8:
machine: true
parallelism: 4
./.ci/no-exception-test.sh no-exception-only-javadoc
no-error-xwiki:
docker:
- image: checkstyle/jdk-8-groovy-git-mvn:1.8.0_282-3.0.8-2.25.1-3.6.3
steps:
- attach_workspace:
at: /home/circleci/
- checkout
- run:
command: |
RUN_JOB=`cat .ci-temp/run_job`
echo "RUN_JOB="$RUN_JOB
if [[ $RUN_JOB == 1 ]]; then
echo "./.ci/pitest.sh pitest-common-2" >> commands.txt
CMD="$(circleci tests split commands.txt)"
echo "Command: $CMD"
eval $CMD
else
echo "build is skipped ..."
fi
- store_artifacts:
path: ./target/pit-reports

./.ci/validation.sh no-error-xwiki
workflows:
version: 2
pitest-testing:
no-exception-tests:
jobs:
- build-caches
- pitest1:
requires:
- build-caches
- pitest2:
requires:
- build-caches
- pitest3:
requires:
- build-caches
- pitest4:
requires:
- build-caches
- pitest5:
requires:
- build-caches
- pitest6:
requires:
- build-caches
# we do not do thorough testing of gui part
# - pitest7:
# requires:
# - build-caches
- pitest8:
requires:
- build-caches
- no-exception-lucene-and-others-javadoc
- no-exception-cassandra-storm-tapestry-javadoc
- no-exception-hadoop-apache-groovy-scouter-javadoc
- no-exception-only-javadoc
- no-error-xwiki
Loading

0 comments on commit 1733cd4

Please sign in to comment.