Skip to content

Commit

Permalink
infra: update CircleCI config
Browse files Browse the repository at this point in the history
  • Loading branch information
nrmancuso committed Mar 5, 2023
1 parent 2489785 commit 65c45d6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
15 changes: 10 additions & 5 deletions .ci/validation.sh
Expand Up @@ -48,7 +48,7 @@ sevntu-checks)
cd sevntu-checks
mvn -e --no-transfer-progress -Pcoverall install
mvn -e --no-transfer-progress verify -Pno-validations,selftesting
if [[ $TRAVIS == 'true' ]]; then
if [[ $CI == 'true' ]]; then
mvn -e --no-transfer-progress -Pcoverall jacoco:report coveralls:report
fi
;;
Expand Down Expand Up @@ -117,7 +117,10 @@ sonarqube)
# SONAR_TOKEN=xxxxxx ./.ci/validation.sh sonarqube
# execution on local for non-master:
# SONAR_TOKEN=xxxxxx PR_NUMBER=xxxxxx PR_BRANCH_NAME=xxxxxx ./.ci/validation.sh sonarqube
checkForVariable "SONAR_TOKEN"
if [ -z "$SONAR_TOKEN" ]; then
echo "SONAR_TOKEN is not set."
exit 1
fi

if [[ $PR_NUMBER =~ ^([0-9]+)$ ]]; then
SONAR_PR_VARIABLES="-Dsonar.pullrequest.key=$PR_NUMBER"
Expand All @@ -129,12 +132,14 @@ sonarqube)
export MAVEN_OPTS='-Xmx2000m'
# until https://github.com/checkstyle/checkstyle/issues/11637
# shellcheck disable=SC2086
mvn -e --no-transfer-progress -Pno-validations clean package sonar:sonar \
mvn -e --no-transfer-progress clean package sonar:sonar \
$SONAR_PR_VARIABLES \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.login="$SONAR_TOKEN" \
-Dsonar.projectKey=org.checkstyle:sevntu \
-Dsonar.organization=checkstyle
-Dsonar.projectKey=org.checkstyle:sevntu-checks \
-Dsonar.organization=checkstyle \
-Dmaven.test.failure.ignore=true \
-Dcheckstyle.ant.skip=true -Dpmd.skip=true
echo "report-task.txt:"
cat target/sonar/report-task.txt
echo "Verification of sonar gate status"
Expand Down
4 changes: 2 additions & 2 deletions .circleci/config.yml
Expand Up @@ -20,15 +20,15 @@ jobs:
- restore_cache:
name: Restore Maven repo cache
keys:
- mvn-cache-{{ checksum "pom.xml" }}
- mvn-cache-{{ checksum "sevntu-checks/pom.xml" }}
- run:
command: << parameters.command >>
- run:
command: |
./.ci/validation.sh git-diff
- save_cache:
name: Save Maven repo cache
key: mvn-cache-{{ checksum "pom.xml" }}
key: mvn-cache-{{ checksum "sevntu-checks/pom.xml" }}
paths:
- .m2

Expand Down
Expand Up @@ -25,6 +25,7 @@
<!-- other images that do not support newer curl commands until
https://github.com/checkstyle/checkstyle/issues/12451 -->
<suppress id="properCurlCommand" files="bump-cs-version\.yml"/>
<suppress id="properCurlCommand" files="sonar-break-build\.sh"/>

<!-- numberOfTestCasesInXpath does not apply to sevntu -->
<suppress id="numberOfTestCasesInXpath" files=".*" />
Expand Down

0 comments on commit 65c45d6

Please sign in to comment.