# 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: Build jvm language modules

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 1.8
      uses: actions/setup-java@v1
      with:
        java-version: 1.8
        
    - name: Gradle cache
      uses: actions/cache@v2
      with:
        path: ~/.gradle
        key: gradle   
        
    - name: Build with Gradle
      run: gradle -s build

    - name: Build Scala3
      working-directory: scala3-examples
      run: sbt compile

    - name: Code style Check
      run: gradle spotlessCheck
