Skip to content

Commit

Permalink
Migrate from Travis CI to GitHub Actions (#237)
Browse files Browse the repository at this point in the history
While there, drop the now-obsolete Takari Maven plugin.
  • Loading branch information
ibabiankou authored Oct 10, 2022
1 parent d2fd86f commit ff97ce2
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 48 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Build and verify
on:
pull_request:
push:
branches: [ master ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- jdk: 11.0.16
sonarEnabled: true
- jdk: 17.0.4
sonarEnabled: false
steps:
- name: Check out code
uses: actions/[email protected]
with:
# Fetch entire history for SonarCloud analysis.
fetch-depth: 0
- name: Set up JDK
uses: actions/[email protected]
with:
java-version: ${{ matrix.jdk }}
distribution: temurin
cache: maven
- name: Cache SonarCloud packages
if: ${{ matrix.sonarEnabled }}
uses: actions/[email protected]
with:
path: "${HOME}/.sonar/cache"
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Display build environment details
run: mvn --version
- name: Build project
run: mvn -T1C install
- name: Perform SonarCloud analysis
if: ${{ matrix.sonarEnabled }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn sonar:sonar
- name: Remove installed project artifacts
run: mvn build-helper:remove-project-artifact
2 changes: 1 addition & 1 deletion .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--batch-mode --errors --strict-checksums
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Picnic OSS Maven Parent

[![Build Status][travisci-badge]][travisci-builds]
[![GitHub Actions][github-actions-build-badge]][github-actions-build-master]
[![Maven Central][maven-central-badge]][maven-central-browse]
[![SonarCloud Quality Gate][sonarcloud-badge-quality-gate]][sonarcloud-dashboard]
[![SonarCloud Bugs][sonarcloud-badge-bugs]][sonarcloud-measure-reliability]
Expand Down Expand Up @@ -34,6 +34,8 @@ When submitting changes, please make every effort to follow existing
conventions and style in order to keep the configuration as readable as
possible.

[github-actions-build-badge]: https://github.com/PicnicSupermarket/oss-parent/actions/workflows/build.yaml/badge.svg
[github-actions-build-master]: https://github.com/PicnicSupermarket/oss-parent/actions/workflows/build.yaml?query=branch%3Amaster
[maven-central-badge]: https://img.shields.io/maven-central/v/tech.picnic/oss-parent.svg
[maven-central-browse]: https://repo1.maven.org/maven2/tech/picnic/oss-parent/
[maven-central-search]: https://search.maven.org
Expand All @@ -47,5 +49,3 @@ possible.
[sonarcloud-measure-reliability]: https://sonarcloud.io/component_measures?id=tech.picnic%3Aoss-parent&metric=Reliability
[sonarcloud-measure-security]: https://sonarcloud.io/component_measures?id=tech.picnic%3Aoss-parent&metric=Security
[sonarcloud-measure-maintainability]: https://sonarcloud.io/component_measures?id=tech.picnic%3Aoss-parent&metric=Maintainability
[travisci-badge]: https://travis-ci.org/PicnicSupermarket/oss-parent.svg?branch=master
[travisci-builds]: https://travis-ci.org/PicnicSupermarket/oss-parent
27 changes: 11 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
<url>https://github.com/PicnicSupermarket/oss-parent/issues</url>
</issueManagement>
<ciManagement>
<system>Travis CI</system>
<url>https://travis-ci.com/PicnicSupermarket/oss-parent</url>
<system>GitHub Actions</system>
<url>https://github.com/PicnicSupermarket/oss-parent/actions</url>
</ciManagement>
<distributionManagement>
<repository>
Expand All @@ -66,9 +66,10 @@
<!-- The test JVMs are short-running. By disabling certain
expensive JIT optimizations we actually speed up most tests. -->
-XX:TieredStopAtLevel=1
<!-- We cap memory usage. This is especially relevant on Travis CI,
but locally this should also be more than enough. -->
-Xmx512m
<!-- We cap memory usage. This may be relevant for build agents,
but also prevents excessive memory usage by heavily parallelized
local builds. -->
-Xmx1024m
<!-- This argument cannot be set through Surefire's
'systemPropertyVariables' configuration setting. Setting the file
encoding is necessary because forked unit test invocations
Expand All @@ -87,14 +88,16 @@
from showing up in the dock and capturing window focus. -->
-Djava.awt.headless=true
</argLine>
<!-- Our build system (Travis CI) provides a monotonically increasing
build number. When building locally, this number is obviously absent.
So we provide a default value. -->
<!-- Our build system provides a monotonically increasing build number.
When building locally, this number is obviously absent. So we provide a
default value. -->
<build.number>LOCAL</build.number>
<!-- Property using which additional Error Prone flags can be
specified. Used by the `patch` profile to enable patching. -->
<error-prone.args />
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>picnic-technologies</sonar.organization>
<version.auto-service>1.0.1</version.auto-service>
<version.error-prone>2.10.0</version.error-prone>
<version.error-prone-javac>9+181-r4173-1</version.error-prone-javac>
Expand Down Expand Up @@ -306,14 +309,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.takari</groupId>
<artifactId>maven</artifactId>
<version>0.7.7</version>
<configuration>
<maven>${version.maven}</maven>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down

0 comments on commit ff97ce2

Please sign in to comment.