Coeur-Morny-Cono/.github/workflows/build.yml

37 lines
1.2 KiB
YAML

name: "Build"
run-name: "Build projects to ensure compiling is successful"
on: [workflow_call]
jobs:
compile:
name: "Compile Project"
runs-on: ubuntu-latest
steps:
- name: "Check if there's already have cache"
id: check-cache
uses: actions/cache/restore@v4
with:
path: "./"
key: ${{ runner.os }}-build-${{ github.sha }}
lookup-only: 'true'
- if: steps.check-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v4
- if: steps.check-cache.outputs.cache-hit != 'true'
name: "Setup Java 21"
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
# - if: steps.check-cache.outputs.cache-hit != 'true'
# name: "Setup Gradle"
# uses: gradle/actions/setup-gradle@v4
- if: steps.check-cache.outputs.cache-hit != 'true'
name: "Compile Project"
run: ./gradlew classes --no-daemon
- if: steps.check-cache.outputs.cache-hit != 'true'
name: "Cache the built project"
uses: actions/cache/save@v4
with:
path: "./"
key: ${{ runner.os }}-build-${{ github.sha }}