name: Build Android Project
on: 
  push:
    branches: [ unstable ]
  pull_request:
    branches: [ unstable ]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - name: Clone repo
      uses: actions/checkout@v2
    - name: Installing JDK 8
      uses: actions/setup-java@v2
      with:
        distribution: 'zulu'
        java-version: '8'
    - name: Installing Cordova!
      run: |
        sudo npm i cordova@10.0.0 -g
    - name: Installing the npm dependencies!
      run: |
        cd testapp
        npm i
    - name: Copying nodejs-mobile-cordova plugin
      run: |
        cd testapp
        npm run copy-module
    - name: Preparing the Android project!
      run: |
        cd testapp
        cordova prepare android
    - name: Building the Android project!
      run: |
        cd testapp
        cordova build android
