diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..6407d87d5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +on: + push: + branches: + - master + - release/** + pull_request: + +jobs: + CI_Sonar: + # carries Sonar secret + environment: CI + env: + # The SonarScanner for Maven automatically picks up the value directly from the environment variable. + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + # According to Sonar: Needed to get PR information, if any + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + # unlimited fetch depth for Sonar + fetch-depth: 0 + - name: Set up JDK 8 + uses: actions/setup-java@v3 + with: + java-version: '8' + # some arbitrary distribution selected + distribution: 'temurin' + cache: maven + - name: Build with Maven + # -B means: batch-mode (no questions, no progress-related log pollution) + # coverage profile is needed for test coverage for sonar + run: mvn test -Pcoverage -B + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + # some arbitrary distribution selected + distribution: 'temurin' + cache: maven + - name: Run Sonar analyzing + # specified the project key explicitly because I didn't like the automatically generate Maven-based name (com.leokom:chess) + # thanks to this explicit specification we're free to change Maven coordinates + # the organization key was found here: https://sonarcloud.io/account/organizations + run: mvn sonar:sonar + -Dsonar.projectKey=leokom-chess + -Dsonar.organization=lrozenblyum-github + -Dsonar.host.url=https://sonarcloud.io diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 462874338..000000000 --- a/.travis.yml +++ /dev/null @@ -1,31 +0,0 @@ -language: java - -jdk: - - openjdk8 - -dist: xenial - -addons: - sonarcloud: - # the organization key was found here: https://sonarcloud.io/account/organizations - organization: "lrozenblyum-github" - -script: - # fixes SonarCloud warning: - # 'Shallow clone detected during the analysis. Some files will miss SCM information. - # This will affect features like auto-assignment of issues. Please configure your build to disable shallow clone.' - - git fetch --unshallow --quiet - # by default travis 'install' phase will execute - # mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V - # travis 'script' phase is by default: mvn test -B - # -B means: batch-mode (no questions, no progress-related logs pollution) - # coverage profile is needed for test coverage for sonar - - mvn test -Pcoverage -B - # manually switching from OpenJDK11. Travis CI doc points us to use install-jdk.sh which fails - # xenial distributive at the moment already has OpenJDK8 + OpenJDK11 installed. Just env. vars changes seem to be needed. - - export JAVA_HOME=/usr/local/lib/jvm/openjdk11 - - export PATH=${JAVA_HOME}/bin:$PATH - - java -version - # specified the project key explicitly because I didn't like the automatically generate Maven-based name (com.leokom:chess) - # thanks to this explicit specification we're free to change Maven coordinates - - mvn sonar:sonar -Dsonar.projectKey=leokom-chess diff --git a/README.md b/README.md index c6a834759..8986bc609 100644 --- a/README.md +++ b/README.md @@ -70,10 +70,8 @@ The release consists of: * binaries in *.zip ## Continuous Integration -### Travis CI -Builds: https://travis-ci.com/lrozenblyum/chess/builds - -[![Build Status](https://travis-ci.com/lrozenblyum/chess.svg?branch=master)](https://travis-ci.com/lrozenblyum/chess) +### GitHub Actions +[![CI](https://github.com/lrozenblyum/chess/actions/workflows/ci.yml/badge.svg)](https://github.com/lrozenblyum/chess/actions/workflows/ci.yml) ### SonarCloud Full overview: https://sonarcloud.io/dashboard?id=leokom-chess diff --git a/pom.xml b/pom.xml index 6d4fbd3b7..db236664d 100644 --- a/pom.xml +++ b/pom.xml @@ -323,7 +323,7 @@ report - + test report @@ -343,7 +343,7 @@ - 2.13.3 + 2.17.1 E:\Games\WinBoard-4.8.0\${brandName} @@ -352,4 +352,4 @@ LeokomChess ${brandName}-${project.version} - \ No newline at end of file + diff --git a/src/test/java/com/leokom/games/chess/SimulatorMultiRunnerIT.java b/src/test/java/com/leokom/games/chess/SimulatorMultiRunnerIT.java index ebbe335ff..fdbd93147 100644 --- a/src/test/java/com/leokom/games/chess/SimulatorMultiRunnerIT.java +++ b/src/test/java/com/leokom/games/chess/SimulatorMultiRunnerIT.java @@ -18,7 +18,7 @@ /** * Author: Leonid - * Trying to avoid Travis limitation on test duration < 10 minutes: + * Historical reasons of the collector usage: trying to avoid Travis limitation on test duration < 10 minutes: * run every game in a separate test, collect all results and analyze * Date-time: 24.04.16 22:54 */