-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate from Travis CI to GitHub Actions #237
Changes from 10 commits
f8b7f8f
116ac7d
1be52f3
568a71f
84645f0
a3758f6
fdbe806
8149591
b0f96d0
2770152
39effd9
e6ba577
bba7121
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Build and verify | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
push: | ||
branches: [$default-branch] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We saw in PicnicSupermarket/error-prone-support#278 that unfortunately this doesn't work. |
||
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: ~/.sonar/cache | ||
key: ${{ runner.os }}-sonar | ||
restore-keys: ${{ runner.os }}-sonar | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice. (In a separate PR) we might want to do something similar for Maven dependencies. (Or are those cached by default? Below we have "Remove installed project artifacts" after all.) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, nevermind; I now see the |
||
- name: Display build environment details | ||
run: mvn --version | ||
- name: Build the 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 | ||
-Dsonar.host.url=https://sonarcloud.io | ||
-Dsonar.organization=picnic-technologies | ||
-Dsonar.projectKey=tech.picnic:oss-parent | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first two will also apply downstream; we can add them to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems to work 😄 |
||
- name: Remove installed project artifacts | ||
run: mvn build-helper:remove-project-artifact |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--batch-mode --errors --strict-checksums |
This file was deleted.
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] | ||
|
@@ -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/error-prone-support/actions/workflows/build.yaml/badge.svg | ||
[github-actions-build-master]: https://github.com/PicnicSupermarket/error-prone-support/actions/workflows/build.yaml?query=branch%3Amaster | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👀 wrong project. |
||
[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 | ||
|
@@ -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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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> | ||
|
@@ -66,9 +66,9 @@ | |
<!-- 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 is especially relevant on CI, but | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change is also based on our internal build file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, we use a different text in |
||
locally this should also be more than enough. --> | ||
-Xmx1024m | ||
<!-- This argument cannot be set through Surefire's | ||
'systemPropertyVariables' configuration setting. Setting the file | ||
encoding is necessary because forked unit test invocations | ||
|
@@ -87,7 +87,7 @@ | |
from showing up in the dock and capturing window focus. --> | ||
-Djava.awt.headless=true | ||
</argLine> | ||
<!-- Our build system (Travis CI) provides a monotonically increasing | ||
<!-- Our build system (GitHub Actions) provides a monotonically increasing | ||
build number. When building locally, this number is obviously absent. | ||
So we provide a default value. --> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll sync the phrasing with |
||
<build.number>LOCAL</build.number> | ||
|
@@ -306,14 +306,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> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are the default, so we can omit them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see I forgot to push this.