This is an automated email from the ASF dual-hosted git repository. lukaszlenart pushed a commit to branch WW-5232-gh-actions in repository https://gitbox.apache.org/repos/asf/struts.git
commit ab22c7377d39df735715b64f09f21f6c9161c6c0 Author: Lukasz Lenart <lukaszlen...@apache.org> AuthorDate: Tue Sep 20 15:48:21 2022 +0200 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(-) 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 @@ </pluginManagement> </build> </profile> - <profile> - <id>jdk9</id> - <activation> - <jdk>[9,)</jdk> - </activation> - <properties> - <!-- coverall version 4.3.0 does not work with java 9, see https://github.com/trautonen/coveralls-maven-plugin/issues/112 --> - <!-- TODO delete coveralls.skip property after fix of https://github.com/cobertura/cobertura/issues/271 --> - <coveralls.skip>true</coveralls.skip> - </properties> - </profile> <profile> <id>jdk17</id> <activation> @@ -218,33 +207,13 @@ </build> </profile> <profile> - <id>travis-coveralls</id> + <id>coverage</id> + <properties> + <sonar.host.url>https://sonarcloud.io</sonar.host.url> + <sonar.organization>apache</sonar.organization> + <sonar.projectKey>apache_struts</sonar.projectKey> + </properties> <build> - <pluginManagement> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-surefire-plugin</artifactId> - <configuration> - <argLine>${argLine}</argLine> - </configuration> - </plugin> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-failsafe-plugin</artifactId> - <configuration> - <argLine>${argLine}</argLine> - </configuration> - </plugin> - <plugin> - <groupId>org.eclipse.jetty</groupId> - <artifactId>jetty-maven-plugin</artifactId> - <configuration> - <jvmArgs>${argLine}</jvmArgs> - </configuration> - </plugin> - </plugins> - </pluginManagement> <plugins> <plugin> <groupId>org.jacoco</groupId> @@ -258,18 +227,18 @@ </goals> </execution> <execution> - <id>prepare-agent-integration</id> + <id>report</id> <goals> - <goal>prepare-agent-integration</goal> + <goal>report</goal> </goals> + <configuration> + <formats> + <format>XML</format> + </formats> + </configuration> </execution> </executions> </plugin> - <plugin> - <groupId>io.jsonwebtoken.coveralls</groupId> - <artifactId>coveralls-maven-plugin</artifactId> - <version>4.4.1</version> - </plugin> </plugins> </build> </profile>