name: Compile Test

on:
  push:
    branches:
      - main 
      - test

jobs:
  compile_cube_ide:
    runs-on: ubuntu-latest

    steps:
    - name: Git Setup
      run: |
        mkdir -p ~/.ssh
        echo 'Host git.intern.spaceteamaachen.de' >> ~/.ssh/config
        echo ' HostName git.intern.spaceteamaachen.de' >> ~/.ssh/config
        echo ' Port 22222' >> ~/.ssh/config
        cat  ~/.ssh/config        

    - name: Checkout repository
      uses: actions/checkout@v3
      with:
        submodules: 'recursive'
        ssh-key: ${{ secrets.janniskey }}
        ssh-known-hosts: ${{ vars.GITKNOWNHOST }}

    # st-stm32cubeclt_1.14.0_19471_20231121_1200_amd64.sh
    # ./ststlink-server-1.14.0_19471_20231121_1200-linux-amd64.deb 
    #- name: Install Stuff
    #  run: |
    #    apt-get install ./st-stlink-udev-rules-1.14.0_19471_20231121_1200-linux-all.deb 
    #    ./st-stm32cubeclt_1.14.0_19471_20231121_1200_amd64.deb

    - name: Compile
      uses: xanderhendriks/action-build-stm32cubeide@v11.0
      with:
        project-path: '/workspace/ALPAKA/CAN-Demo'
        project-target: 'CAN-Demo/Debug'