name: CI

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0 # all

      - name: Setup .NET 6.0
        uses: actions/setup-dotnet@v1
        with:
          dotnet-version: 6.0.x

      - name: Install SQL CE 📅
        shell: powershell
        run: ./install-sql-ce.ps1

      - name: Cake Build 🏗️
        shell: powershell
        run: ./build.ps1
        env:
          OCTOVERSION_CurrentBranch: ${{ github.ref }}
          AssentNonInteractive: true

      - name: Push NuGet packages to GitHub Packages ⬆️
        if: ${{ format('{0}', env.PACKAGE_KEY) != '' }}
        working-directory: artifacts
        run: dotnet nuget push *.nupkg --api-key ${{ env.PACKAGE_KEY }} --source "https://nuget.pkg.github.com/DbUp/index.json"
        env:
            PACKAGE_KEY: ${{ secrets.GITHUB_TOKEN }}

      - name: Test Report 🧪
        uses: dorny/test-reporter@v1
        if: success() || failure()    # run this step even if previous step failed
        with:
          name: Tests
          path: artifacts/TestResults/*.trx
          reporter: dotnet-trx

name: CI

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  build:
    runs-on: windows-latest

    env:
      DOTNET_NOLOGO: true
      DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # Avoid pre-populating the NuGet package cache

    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0 # all

      - name: Setup .NET 6.0
        uses: actions/setup-dotnet@v1
        with:
          dotnet-version: 6.0.x

      - name: Install SQL CE 📅
        shell: powershell
        run: ./install-sql-ce.ps1

      - name: Cake Build 🏗️
        shell: powershell
        run: ./build.ps1
        env:
          OCTOVERSION_CurrentBranch: ${{ github.ref }}
          AssentNonInteractive: true

      - name: Push NuGet packages to GitHub Packages ⬆️
        if: ${{ format('{0}', env.PACKAGE_KEY) != '' }}
        working-directory: artifacts
        run: dotnet nuget push *.nupkg --api-key ${{ env.PACKAGE_KEY }} --source "https://nuget.pkg.github.com/DbUp/index.json"
        env:
            PACKAGE_KEY: ${{ secrets.GITHUB_TOKEN }}

      - name: Test Report 🧪
        uses: dorny/test-reporter@v1
        if: success() || failure()    # run this step even if previous step failed
        with:
          name: Tests
          path: artifacts/TestResults/*.trx
          reporter: dotnet-trx

Set .NET CLI Environment Variables
Set .NET CLI Environment Variables
