name: AZSL Compiler

on: pull_request

jobs:
  build:

    runs-on: ubuntu-latest
    strategy:
      max-parallel: 1
      matrix:
        python-version: [3.8]

    steps:
    - uses: actions/checkout@v1
    - name: Set up Python ${{ matrix.python-version }}
      uses: actions/setup-python@v1
      with:
        python-version: ${{ matrix.python-version }}
    - name: Get CMake
      uses: lukka/get-cmake@latest
    
    # Dependencies for linux environment
    - name: Install dependencies (Linux) 
      env:
        ACTIONS_ALLOW_UNSECURE_COMMANDS: true
      run: |
        sudo gem install apt-spy2
        sudo apt-spy2 check
        sudo apt-spy2 fix --commit
        sudo apt-get update
        sudo apt-get install gcc
        sudo apt-get install g++
        echo "::set-env name=CC::gcc"
        echo "::set-env name=CXX::g++"
        sudo apt-get install uuid-dev
        python -m pip install --upgrade pip
        pip install pyyaml
    # Build and execute all the tests for Debug & Release
    - name: Build and Execute AZSLc tests
      run: |
        export PYTHONPATH=${PYTHONPATH}:`pwd`
        python test.and.py
