name: Core-CI
permissions:
  contents: read
  pull-requests: write

on:
  pull_request:
    branches: [ main, core/** ]

jobs:
  build-and-test:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v4
      with:
        fetch-depth: 0
    
    - name: Setup .NET
      uses: actions/setup-dotnet@v4
      with:
        dotnet-version: '10.0.x'
    
    - name: Restore dependencies
      run: dotnet restore
      working-directory: core
    
    - name: Build Core
      run: dotnet build --no-restore
      working-directory: core
    
    - name: Test
      run: dotnet test --no-build
      working-directory: core

    - name: Build Core Tests
      run: dotnet build
      working-directory: core/test