From ab22c7377d39df735715b64f09f21f6c9161c6c0 Mon Sep 17 00:00:00 2001 From: Lukasz Lenart Date: Tue, 20 Sep 2022 15:48:21 +0200 Subject: [PATCH] WW-5232 Introduces GH Actions build instead of using Travis --- .github/workflows/maven.yml | 53 ++++++++++++++++++++++++++++++++++ .travis.yml | 29 ------------------- pom.xml | 57 +++++++++---------------------------- 3 files changed, 66 insertions(+), 73 deletions(-) create mode 100644 .github/workflows/maven.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml new file mode 100644 index 000000000..9e40783c7 --- /dev/null +++ b/.github/workflows/maven.yml @@ -0,0 +1,53 @@ +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: Java Build + +on: + pull_request: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8', '11', '17' ] + steps: + - name: Checkout code + uses: actions/checkout@v3.0.2 + - name: Set up cache + uses: actions/cache@v3.0.8 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Set up JDK ${{ matrix.java }} + uses: actions/setup-java@v3 + with: + distribution: adopt + java-version: ${{ matrix.java }} + - name: Build with Maven on Java ${{ matrix.java }} + if: matrix.java != '11' + run: mvn -B -V -DskipAssembly test --no-transfer-progress + - name: Code coverage on Java ${{ matrix.java }} + if: matrix.java == '11' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONARCLOUD_TOKEN }} + run: mvn -B -V -Pcoverage verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar --no-transfer-progress diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e86980e60..000000000 --- a/.travis.yml +++ /dev/null @@ -1,29 +0,0 @@ -dist: jammy -language: java -sudo: false - -jdk: - - openjdk11 - - openjdk17 - -install: true - -env: -global: - - secure: iI7IpfDtS+LUyS2yNuRCR3KelNyvBHuoMQ3gb1UNmR5SSL7jO/p3olQWrQROs28FJ+dpE3lHyIjoHrebKQGJHHAgTG2XWxn+G3fDsf+wSSFSLoDGj0o2SgGXooBbR2dccnNZHCyQaOyE2cIPWaOxrQZFE4No70LQB4mrP/gdkoc= -matrix: - include: - - jdk: openjdk8 - env: STRUTS_IT=true # do integration tests and coverage reports when jdk 11 and 17 tests prospered - -script: - - if [ "$STRUTS_IT" == "true" ]; then - ./mvnw clean install -DskipTests -DskipAssembly -B; - ./mvnw test org.jacoco:jacoco-maven-plugin:report org.jacoco:jacoco-maven-plugin:report-integration org.eluder.coveralls:coveralls-maven-plugin:report -Ptravis-coveralls -DskipAssembly -B; - else - ./mvnw clean package test -DskipAssembly -B; - fi; - -cache: - directories: - - $HOME/.m2 diff --git a/pom.xml b/pom.xml index 50d7ce699..da4ee7a64 100644 --- a/pom.xml +++ b/pom.xml @@ -182,17 +182,6 @@ - - jdk9 - - [9,) - - - - - true - - jdk17 @@ -218,33 +207,13 @@ - travis-coveralls + coverage + + https://sonarcloud.io + apache + apache_struts + - - - - org.apache.maven.plugins - maven-surefire-plugin - - ${argLine} - - - - org.apache.maven.plugins - maven-failsafe-plugin - - ${argLine} - - - - org.eclipse.jetty - jetty-maven-plugin - - ${argLine} - - - - org.jacoco @@ -258,18 +227,18 @@ - prepare-agent-integration + report - prepare-agent-integration + report + + + XML + + - - io.jsonwebtoken.coveralls - coveralls-maven-plugin - 4.4.1 -