name: Test particle-os Basic Functionality

on:
  push:
    branches: [ main, develop ]
    paths:
      - 'recipes/**'
      - 'bib/**'
  pull_request:
    branches: [ main ]
  workflow_dispatch:

jobs:
  test-basic:
    runs-on: ubuntu-latest
    
    steps:
    - name: Checkout code
      uses: actions/checkout@v4
      
    - name: Set up Go
      uses: actions/setup-go@v4
      with:
        go-version: '1.21'
        
    - name: Install dependencies
      run: |
        sudo apt-get update
        sudo apt-get install -y curl qemu-utils
        
    - name: Build particle-os
      run: |
        cd bib
        go build -o particle-os cmd/particle_os/main.go
        
    - name: Test recipe validation
      run: |
        cd bib
        ./particle-os validate ../recipes/minimal-test.yml
        ./particle-os validate ../recipes/simple-server.yml
        
    - name: Test CLI help
      run: |
        cd bib
        ./particle-os --help
        ./particle-os list
        ./particle-os version
        
    - name: Test container inspection
      run: |
        cd bib
        ./particle-os container debian:trixie-slim
