name: Run BaseX Tests

on:
  workflow_dispatch: # Enables manual trigger
  pull_request:
    branches:
      - main

  
jobs:
  test:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout repository
      uses: actions/checkout@v2

    - name: Set up Java
      uses: actions/setup-java@v2
      with:
        java-version: '11'
        distribution: 'temurin'

    - name: Install BaseX
      run: |
        wget http://files.basex.org/releases/10.7/BaseX107.zip
        unzip BaseX107.zip 

    - name: Run BaseX Tests
      run:  'basex/bin/basex -t .'