name: Check that the RGL can successfully build

on:
  - push
  - pull_request

jobs:
  build:
    runs-on: ubuntu-24.04
    env:
      GF_VERSION: 3.12
      DEST: gf-rgl

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

    - name: Download GF
      uses: dsaltares/fetch-gh-release-asset@1.1.1
      with:
        repo: 'GrammaticalFramework/gf-core'
        version: 'tags/release-${{ env.GF_VERSION }}'
        file: 'gf-${{ env.GF_VERSION }}-ubuntu-24.04.deb'
        token: ${{ secrets.GITHUB_TOKEN }}

    - name: Install GF
      run: |
        sudo dpkg -i gf-${GF_VERSION}-ubuntu-24.04.deb

    - name: Czech regression tests
      timeout-minutes: 5
      run: sh tests/czech/check.sh

    - name: Build RGL
      run: |
        mkdir -p ${DEST}
        bash Setup.sh --dest=${DEST} --gf=gf --verbose
