name: Install RamaLama

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  install_ramalama:
    strategy:
      matrix:
        os: [ubuntu-latest, macos-latest]  # Runs on Ubuntu and macOS

    runs-on: ${{ matrix.os }}

    steps:
      - name: Checkout Repository
        uses: actions/checkout@v6

      - name: Set Up Dependencies (Ubuntu)
        timeout-minutes: 20
        if: matrix.os == 'ubuntu-latest'
        run: |
          sudo apt-get install -y lshw curl

      - name: Set Up Dependencies (macOS)
        if: matrix.os == 'macos-latest'
        run: |
          if ! command -v brew &> /dev/null; then
            echo "Homebrew is required but not found. Please install it."
            exit 1
          fi

      - name: Run RamaLama Installer
        run: |
          chmod +x install.sh
          ./install.sh -l

      - name: Verify RamaLama installation
        run: |
          ramalama ls | grep NAME

      - name: RamaLama info
        run: |
          ramalama info

      - name: RamaLama pull
        run: |
          ramalama pull tinyllama
