From 4f5ea8beac73905f084325fe7faf3a72e8c8dd2e Mon Sep 17 00:00:00 2001 From: Rick Ossendrijver Date: Sun, 7 Aug 2022 18:33:25 +0200 Subject: [PATCH] Migrate from Travis CI to GitHub Actions (#158) While there, drop the now-obsolete Takari Maven plugin. --- .github/workflows/build.yaml | 37 +++++++++++++++++++++++++++++++++++ .mvn/maven.config | 1 + .travis.yml | 38 ------------------------------------ pom.xml | 14 ++++++------- 4 files changed, 44 insertions(+), 46 deletions(-) create mode 100644 .github/workflows/build.yaml create mode 100644 .mvn/maven.config delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..65b416bd --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,37 @@ +name: Build and verify +on: + pull_request: + push: + branches: + - 'master' +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + jdk: [ 11.0.16, 17.0.4 ] + steps: + # We run the build twice for each supported JDK: once against the + # original Error Prone release, using only Error Prone checks available + # on Maven Central, and once against the Picnic Error Prone fork, + # additionally enabling all checks defined in this project and any + # Error Prone checks available only from other artifact repositories. + - name: Check out code + uses: actions/checkout@v3.0.2 + - name: Set up JDK + uses: actions/setup-java@v3.4.1 + with: + java-version: ${{ matrix.jdk }} + distribution: temurin + cache: maven + - name: Display build environment details + run: mvn --version + - name: Build project against vanilla Error Prone + run: mvn -T1C install + - name: Build project with self-check against Error Prone fork + run: mvn -T1C clean verify -Perror-prone-fork -Pnon-maven-central -Pself-check -s settings.xml + - name: Remove installed project artifacts + run: mvn build-helper:remove-project-artifact + +# XXX: Enable Codecov once we "go public". +# XXX: Enable SonarCloud once we "go public". diff --git a/.mvn/maven.config b/.mvn/maven.config new file mode 100644 index 00000000..d44ca857 --- /dev/null +++ b/.mvn/maven.config @@ -0,0 +1 @@ +--batch-mode --errors --strict-checksums diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f07a18e5..00000000 --- a/.travis.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -dist: bionic -language: java -jdk: openjdk11 -addons: - sonarcloud: - organization: picnic-technologies - token: "${SONARCLOUD_TOKEN}" -install: - - mvn io.takari:maven:wrapper -script: - # We run the build twice: once against the original Error Prone release, - # using only Error Prone checks available on Maven Central, and once against - # the Picnic Error Prone fork, additionally enabling all checks defined in - # this project and any Error Prone checks available only from other artifact - # repositories. - - ./mvnw clean install - - ./mvnw clean install -Perror-prone-fork -Pnon-maven-central -Pself-check -s settings.xml - # XXX: Enable SonarCloud once we "go public". - # ./mvnw jacoco:prepare-agent surefire:test jacoco:report sonar:sonar - - ./mvnw jacoco:prepare-agent surefire:test jacoco:report -before_cache: - # Don't cache the artifacts we just generated, for multiple reasons: (1) we - # shouldn't need them next time around and (2) if we do, that indicates a - # dependency issue which might otherwise go unnoticed until next time we bump - # the project's version (i.e., when tagging). - - find "${HOME}/.m2/repository" -depth -name '*-SNAPSHOT' -exec rm -r '{}' \; -cache: - directories: - # The local Maven repository in which third party dependencies are stored. - - ${HOME}/.m2/repository - # The Takari Maven Wrapper's storage for downloaded Maven distributions. - - ${HOME}/.m2/wrapper - # The SonarQube analysis cache. - - ${HOME}/.sonar/cache -# XXX: Enable Codecov once we "go public". -#after_success: -# - bash <(curl -s https://codecov.io/bash) diff --git a/pom.xml b/pom.xml index 00e511e8..f6dcce2c 100644 --- a/pom.xml +++ b/pom.xml @@ -140,6 +140,7 @@ 3.0.0 1.0 11 + 3.6.3 4.6.1 1.0.1 @@ -488,14 +489,6 @@ - - io.takari - maven - 0.7.7 - - ${version.maven} - - org.apache.maven.plugins maven-checkstyle-plugin @@ -1046,6 +1039,11 @@ + + org.codehaus.mojo + build-helper-maven-plugin + 3.3.0 + org.codehaus.mojo buildnumber-maven-plugin