From acc8ec44d2fc8c3b7810035c59a6bbd1317dc52d Mon Sep 17 00:00:00 2001 From: johnniang Date: Thu, 30 Jan 2020 23:26:39 +0800 Subject: [PATCH 1/2] Enable github ci on pull request --- .github/workflows/gradle.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 0e1231212..82de54e35 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,6 +1,8 @@ name: Java CI -on: [push] +on: + pull_request: + push: jobs: build: @@ -8,10 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build with Gradle - run: ./gradlew build + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - name: Test with Gradle + run: ./gradlew test + - name: Build with Gradle + run: ./gradlew build -x test From 73bea52f68c499593670e06281b8b34fe5c0598d Mon Sep 17 00:00:00 2001 From: johnniang Date: Fri, 31 Jan 2020 11:22:00 +0800 Subject: [PATCH 2/2] Enable github action cache for CI --- .github/workflows/gradle.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 82de54e35..d4a50581e 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,4 +1,4 @@ -name: Java CI +name: Halo CI on: pull_request: @@ -15,6 +15,14 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 + - name: Cache Gradle + id: cache-gradle + uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: | + ${{ runner.os }}-gradle- - name: Test with Gradle run: ./gradlew test - name: Build with Gradle