-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Set Up GitHub Actions CI and SNAPSHOT uploading (#440)
This change sets up GitHub Actions as a parallel build CI to Travis (for now). GitHub Actions should build NullAway on MacOS X and Linux using JDK 8 and JDK 11, and on Windows using JDK 8. Additionally, this migrates snapshot uploading and coverage tracking to GitHub Actions, disabling the equivalent Travis CI events as they will likely conflict. This also switches the Gradle plugin we were using for code coverage support and re-enabled coverage uploads to Coveralls (from GH Actions). Finally, this includes a few tooling dependency upgrades, most notable an upgrade of the Android SDK and build-tools used to build this repo to v30. See #408
- Loading branch information
1 parent
7164a48
commit eed3fc0
Showing
7 changed files
with
94 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if [ -n "$(git status --porcelain)" ]; then | ||
echo 'warning: source tree contains uncommitted changes; .gitignore patterns may need to be fixed' | ||
git status | ||
false | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Continuous integration | ||
on: | ||
- push | ||
jobs: | ||
build: | ||
name: "JDK ${{ matrix.java }} on ${{ matrix.os }}" | ||
strategy: | ||
matrix: | ||
include: | ||
- os: macos-latest | ||
java: 8 | ||
- os: macos-latest | ||
java: 11 | ||
- os: ubuntu-latest | ||
java: 8 | ||
- os: ubuntu-latest | ||
java: 11 | ||
- os: windows-latest | ||
java: 8 | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Check out NullAway sources | ||
uses: actions/checkout@v2 | ||
- name: 'Set up JDK ${{ matrix.java }}' | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: ${{ matrix.java }} | ||
- name: Build and test using Gradle and Java 8 | ||
uses: eskatos/gradle-command-action@v1 | ||
with: | ||
arguments: verGJF build | ||
if: matrix.java == '8' | ||
- name: Build and test using Gradle and Java 11 | ||
uses: eskatos/gradle-command-action@v1 | ||
with: | ||
arguments: :nullaway:test | ||
if: matrix.java == '11' | ||
- name: Report jacoco coverage | ||
uses: eskatos/gradle-command-action@v1 | ||
env: | ||
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
with: | ||
arguments: jacocoTestReport coverallsJacoco | ||
if: runner.os == 'Linux' && matrix.java == '8' | ||
- name: Check that Git tree is clean after build and test | ||
run: ./.buildscript/check_git_clean.sh | ||
publish_snapshot: | ||
name: 'Publish snapshot' | ||
needs: [build] | ||
if: github.event_name == 'push' && github.repository == 'uber/NullAway' && github.ref == 'refs/heads/master' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Check out repository' | ||
uses: actions/checkout@v2 | ||
- name: Cache Gradle caches | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: ${{ runner.os }}-gradle-caches- | ||
- name: Cache Gradle wrapper | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradlew-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} | ||
restore-keys: ${{ runner.os }}-gradlew-wrapper- | ||
- name: 'Set up JDK 8' | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
- name: 'Publish' | ||
env: | ||
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_USERNAME: ${{ secrets.SONATYPE_NEXUS_USERNAME }} | ||
ORG_GRADLE_PROJECT_SONATYPE_NEXUS_PASSWORD: ${{ secrets.SONATYPE_NEXUS_PASSWORD }} | ||
run: ./gradlew clean uploadArchives |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters