name: Tests
on:
  push:
    branches:
      - main
  pull_request:
    types: [ opened, synchronize, reopened ]
jobs:
  TactilityTests:
    runs-on: ubuntu-latest
    steps:
      - name: "Checkout repo"
        uses: actions/checkout@v6
        with:
          submodules: recursive
      - name: "Configure Project"
        uses: threeal/cmake-action@v1.3.0
      - name: "Prepare Project"
        run: cmake -S ./ -B build
      - name: "Build Tests"
        run: cmake --build build --target build-tests
      - name: "Run TactilityFreeRtos Tests"
        run: build/Tests/TactilityFreeRtos/TactilityFreeRtosTests
      - name: "Run Tactility Tests"
        run: build/Tests/Tactility/TactilityTests
      - name: "Run TactilityKernel Tests"
        run: build/Tests/TactilityKernel/TactilityKernelTests
      - name: "Run CryptModuleTests Tests"
        run: build/Tests/crypt-module/CryptModuleTests
  DevicetreeTests:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v6
        with:
          persist-credentials: false
          submodules: recursive
      - name: "Install Python Dependencies"
        shell: bash
        run: pip install lark==1.3.1 pyyaml==6.0.3
      - name: "Run Devicetree Tests"
        shell: bash
        working-directory: Buildscripts/DevicetreeCompiler/tests
        run: python test_integration.py
