name: Test Java Proxy 

on:
  push:
    branches: [ master, actions-setup ]
  pull_request:
    branches: [ master ]

jobs:
  build:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    env:
      ACROLINX_API_USERNAME: ${{ secrets.TEST_SERVER_USERNAME }}
      ACROLINX_API_SSO_TOKEN: ${{ secrets.TEST_SERVER_SSO_TOKEN }}

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 8
      uses: actions/setup-java@v2
      with:
        java-version: '8'
        distribution: 'adopt'

    - name: Build proxy
      run: |
        cd java/servlet/
        mvn compile

    - name: Test proxy with Unstable
      env:
        ACROLINX_URL: ${{ secrets.TEST_SERVER_URL_UNSTABLE }}
        ACROLINX_API_TOKEN: ${{ secrets.TEST_SERVER_API_TOKEN_UNSTABLE }}

      run: |
        cd java/servlet/
        mvn '-Dtest=com.acrolinx.*Test' test

    - name: Test proxy with Stable
      env:      
        ACROLINX_URL: ${{ secrets.TEST_SERVER_URL_STABLE }}
        ACROLINX_API_TOKEN: ${{ secrets.TEST_SERVER_API_TOKEN_STABLE }}

      run: |
        cd java/servlet/
        curl -Is $ACROLINX_URL | head -1
        mvn '-Dtest=com.acrolinx.*Test' test


name: Test Java Proxy 

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]
  schedule:
    - cron: "* 12 * * *"

jobs:
  build:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
    env:
      ACROLINX_API_USERNAME: ${{ secrets.TEST_SERVER_USERNAME }}
      ACROLINX_API_SSO_TOKEN: ${{ secrets.TEST_SERVER_SSO_TOKEN }}

    steps:
    - uses: actions/checkout@v2
    - name: Set up JDK 8
      uses: actions/setup-java@v2
      with:
        java-version: '8'
        distribution: 'adopt'

    - name: Build proxy
      run: |
        cd java/servlet/
        mvn compile

    - name: Test proxy with Unstable
      env:
        ACROLINX_URL: ${{ secrets.TEST_SERVER_URL_UNSTABLE }}
        ACROLINX_API_TOKEN: ${{ secrets.TEST_SERVER_API_TOKEN_UNSTABLE }}

      run: |
        cd java/servlet/
        mvn '-Dtest=com.acrolinx.*Test' test

    - name: Test proxy with Stable
      env:      
        ACROLINX_URL: ${{ secrets.TEST_SERVER_URL_STABLE }}
        ACROLINX_API_TOKEN: ${{ secrets.TEST_SERVER_API_TOKEN_STABLE }}

      run: |
        cd java/servlet/
        curl -Is $ACROLINX_URL | head -1
        mvn '-Dtest=com.acrolinx.*Test' test


Add a schedule for daily run
Add a schedule for daily run
