Skip to content

Commit

Permalink
feat(build): split build and test into separate jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Silthus committed Jun 25, 2020
1 parent 95e04eb commit 38f74d4
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions .github/workflows/gradle.yml
Expand Up @@ -10,10 +10,10 @@ jobs:


steps:
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 8
java-version: 11

- name: Cache Gradle
id: cache-gradle
Expand All @@ -24,32 +24,60 @@ jobs:

- uses: actions/checkout@v1

- name: Grant execute permission for gradlew
- name: Grant execute permission to gradlew
run: chmod +x gradlew

- name: Build
run: ./gradlew
run: ./gradlew build -x test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload build artifacts
uses: actions/upload-artifact@v2
with:
path: build/libs
path: "**/build/libs"

test:

runs-on: ubuntu-18.04

steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Cache Gradle
id: cache-gradle
uses: actions/cache@v1
with:
path: ~/.gradle
key: ${{ runner.os }}-gradle

- uses: actions/checkout@v1

- name: Grant execute permission to gradlew
run: chmod +x gradlew

- name: Test
run: ./gradlew test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload CodeCov Report
uses: codecov/codecov-action@v1
with:
file: build/reports/jacoco/**/*.xml
file: "**/build/reports/jacoco/**/*.xml"

- name: Upload Test Report
uses: actions/upload-artifact@v2
if: always()
with:
name: build reports
path: build/reports
path: "**/build/reports"

release:
needs: [build]
needs: [build, test]
if: github.ref == 'refs/heads/master'

runs-on: ubuntu-18.04
Expand Down

0 comments on commit 38f74d4

Please sign in to comment.