65 lines
1.5 KiB
YAML
65 lines
1.5 KiB
YAML
# Builds and tests the project
|
|
|
|
name: Build
|
|
|
|
# On pull requests
|
|
on:
|
|
push:
|
|
paths:
|
|
- '**/src/**'
|
|
- '**/build.gradle'
|
|
- '**/gradle.properties'
|
|
- '**/settings.gradle'
|
|
- .github/workflows/build.yml
|
|
- LICENCE
|
|
pull_request:
|
|
paths:
|
|
- '**/src/**'
|
|
- '**/build.gradle'
|
|
- '**/gradle.properties'
|
|
- '**/settings.gradle'
|
|
- .github/workflows/build.yml
|
|
- LICENCE
|
|
|
|
jobs:
|
|
build:
|
|
name: Build
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: ✨ Checkout repository
|
|
uses: actions/checkout@v2
|
|
|
|
- name: 🛂 Validate Gradle wrapper
|
|
uses: gradle/wrapper-validation-action@v1
|
|
|
|
- name: 🏗 Set up JDK 16
|
|
uses: actions/setup-java@v2
|
|
with:
|
|
java-version: 16
|
|
distribution: adopt
|
|
|
|
- name: 📷 Begin 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: 🔨 Build artifacts
|
|
run: ./gradlew clean build
|
|
|
|
- name: 📦 Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: artifacts
|
|
path: '**/build/libs/'
|
|
|
|
- name: 🧨 Cleanup Gradle cache
|
|
run: |
|
|
rm -f ~/.gradle/caches/modules-2/modules-2.lock
|
|
rm -f ~/.gradle/caches/modules-2/gc.properties
|