#  This workflow will build the MEMAP project with Maven and generate artifacts

name: Master build with maven

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master

jobs:

  install-project:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout memap
      uses: actions/checkout@v2
      with:
        ref: master
    - name: Set up JDK 8
      uses: actions/setup-java@v2
      with:
        java-version: '8'
        distribution: 'adopt'
    - name: Cache Maven Packages
      uses: actions/cache@v2
      with:
        path: ~/.m2/repository
        key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
        restore-keys: ${{ runner.os }}-m2
    - name: Build with Maven
      run: |
        mvn -f projects/memapOpcServer/pom.xml clean compile install -Dmaven.test.skip=true 
        mvn -f core/cim15/pom.xml clean compile install -Dmaven.test.skip=true 
        mvn -f core/powerflow/pom.xml clean compile install -Dmaven.test.skip=true 
        mvn -f core/gridarchitect/pom.xml clean compile install -Dmaven.test.skip=true
        mvn -f projects/memapCore/pom.xml clean compile install -Dmaven.test.skip=true
        mvn -f projects/memapGui/pom.xml clean compile install -Dmaven.test.skip=true
        mkdir artifacts
        cp projects/memapGui/target/*jar-with-dependencies.jar artifacts/memapPlanungsTool.jar
    - name: Persist artifact
      uses: actions/upload-artifact@v2
      with:
        name: memap
        path: artifacts
    


Add CI workflow for the master branch
Add CI workflow for the master branch
