name: "Test: Functionality"

on:
  push:
    branches: [ main ]
  pull_request:
    branches: [ main ]

jobs:

  functionality_tests:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
      with:
        submodules: true
    - name: Set up Python
      uses: actions/setup-python@v3
      with:
        python-version: '3.x'
    - uses: actions/checkout@v3
    - name: Install dependencies
      run: |
        python -m pip install -r reqs/requirements.txt
    - name: make test
      run: make test
    - name: Secure Random
      run: |
        sudo apt-get install libbsd-dev -y
        make test USE_SECURE_RANDOM=1
    - name: Lex/Yacc Fallback
      run: make test LEX_FALLBACK=1 YACC_FALLBACK=1
    - name: Test installation
      run: |
        make install
        dice --version
        dice --help