Skip to content

Commit

Permalink
Migrate from Travis CI to GitHub Actions. (#381)
Browse files Browse the repository at this point in the history
* Migrate from Travis CI to GitHub Actions.

Travis CI is moving to billed plans per https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing. Volley's requirements are simple and should work fine with GitHub Actions, which would hopefully be supported as long as GitHub itself is.

Co-authored-by: Joe Bowbeer <joe.bowbeer@gmail.com>
  • Loading branch information
jpd236 and joebowbeer authored Nov 9, 2020
1 parent bdc0e39 commit cd08391
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 45 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/gradle-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Gradle

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build with Gradle
run: ./gradlew --continue verifyGoogleJavaFormat build connectedCheck
- name: Publish snapshot
if: github.event_name == 'push'
env:
CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }}
CI_DEPLOY_PASSWORD: ${{ secrets.CI_DEPLOY_PASSWORD }}
run: ./publish-snapshot-on-commit.sh
41 changes: 0 additions & 41 deletions .travis.yml

This file was deleted.

10 changes: 6 additions & 4 deletions publish-snapshot-on-commit.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
set -eu

if [ "$TRAVIS_REPO_SLUG" == "google/volley" ] && \
[ "$TRAVIS_PULL_REQUEST" == "false" ] && \
[ "$TRAVIS_BRANCH" == "master" ]; then
GITHUB_BRANCH=${GITHUB_REF#refs/heads/}

if [ "$GITHUB_REPOSITORY" == "google/volley" ] && \
[ "$GITHUB_EVENT_NAME" == "push" ] && \
[ "$GITHUB_BRANCH" == "master" ]; then
echo -e "Publishing snapshot build to OJO...\n"

./gradlew artifactoryPublish

echo -e "Published snapshot build to OJO"
else
echo -e "Not publishing snapshot"
fi
fi

0 comments on commit cd08391

Please sign in to comment.