name: Feedser CI

on:
  push:
    branches: ["main", "develop"]
  pull_request:
    branches: ["main", "develop"]

jobs:
  build-and-test:
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository
        uses: actions/checkout@v4

      - name: Setup .NET 10 preview
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: 10.0.100-rc.1.25451.107
          include-prerelease: true

      - name: Restore dependencies
        run: dotnet restore src/StellaOps.Feedser/StellaOps.Feedser.sln

      - name: Build
        run: dotnet build src/StellaOps.Feedser/StellaOps.Feedser.sln --configuration Release --no-restore -warnaserror

      - name: Test
        run: dotnet test src/StellaOps.Feedser/StellaOps.Feedser.Tests/StellaOps.Feedser.Tests.csproj --configuration Release --no-restore --logger "trx;LogFileName=feedser-tests.trx"
