Merge pull request #23 from SanctumLabs/dependabot/gradle/org.jetbrai… #60
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 workflow will build a Java project with Gradle | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle | |
name: Lint, Test & Build | |
on: [ push ] | |
jobs: | |
dependencies: | |
name: Dependency Resolution | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '11' | |
distribution: 'adopt' | |
- name: Cache Gradle packages | |
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: Install Dependencies | |
run: make install | |
lint: | |
name: Linting | |
runs-on: ubuntu-latest | |
needs: | |
- dependencies | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Restore 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: Lint Application | |
run: make lint | |
test: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
needs: | |
- lint | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run tests | |
run: make test-coverage | |
# Ref: https://github.com/codecov/codecov-action | |
- name: Upload Test Coverage | |
uses: codecov/codecov-action@v2 | |
with: | |
files: ./build/reports/jacoco/test/jacocoTestReport.xml | |
flags: unittests | |
fail_ci_if_error: true | |
verbose: true | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run Build | |
run: make build | |
- name: Upload App Build | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build | |
path: build/libs | |
- name: Cleanup Gradle Cache | |
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. | |
# Restoring these files from a GitHub Actions cache might cause problems for future builds. | |
run: | | |
rm -f ~/.gradle/caches/modules-2/modules-2.lock | |
rm -f ~/.gradle/caches/modules-2/gc.properties |