-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port from Travis-CI to GitHub Actions
Travis-CI no longer has a free tier (only a free trial). That was a major reason we used Travis-CI, so that external contributors would be able to run the CI on their forks. Iterating on a Travis config in a personal repo was also quite convenient. The other reason was that Travis-CI was safe to run even with untrusted code. Since the introduction of the permissions field in workflows, GitHub Actions appears safe to run untrusted code and has a free tier for external contributors. GitHub Actions and Google Cloud Build are the main contenders for a Kokoro replacement, but Cloud Build isn't safe for untrusted code. Instead of migrating to Travis-CI.com from Travis-CI.org, let's migrate to GitHub Actions and gain some familiarity. I've really appreciated Travis-CI.org and have wanted to pay for it for years but wasn't about to give it write permission to the repo. I'm disappointed to migrate off it, now that the permissions issues have been sorted out.
- Loading branch information
Showing
4 changed files
with
70 additions
and
66 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,63 @@ | ||
name: GitHub Actions Linux Testing | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- 'v1.*' | ||
pull_request: | ||
schedule: | ||
- cron: '54 19 * * SUN' # weekly at a "random" time | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
jre: [8, 11] | ||
fail-fast: false # Should swap to true if we grow a large matrix | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v2 | ||
with: | ||
java-version: ${{ matrix.jre }} | ||
distribution: 'adopt' | ||
|
||
- name: Gradle cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Maven cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
!~/.m2/repository/io/grpc | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', 'build.gradle') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Protobuf cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/protobuf-cache | ||
key: ${{ runner.os }}-maven-${{ hashFiles('buildscripts/make_dependencies.sh') }} | ||
|
||
- name: Build | ||
run: buildscripts/kokoro/unix.sh | ||
- name: Check for modified codegen | ||
run: test -z "$(git status --porcelain)" || (git status && echo Error Working directory is not clean. Forget to commit generated files? && false) | ||
|
||
- name: Coveralls | ||
if: matrix.jre == 8 # Upload once, instead of for each job in the matrix | ||
run: ./gradlew :grpc-all:coveralls -x compileJava | ||
- name: Codecov | ||
uses: codecov/codecov-action@v1 |
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 |
---|---|---|
|
@@ -39,3 +39,6 @@ bin | |
|
||
# ARM tests | ||
qemu-arm-static | ||
|
||
# Temporary output dir for artifacts | ||
mvn-artifacts |
This file was deleted.
Oops, something went wrong.
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