diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e1138fa..7ef893e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,29 +1,51 @@ -name: Orchard Core Contrib Testing +name: Orchard Core Contrib Testing - Build on: pull_request: branches: [ main ] - -env: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: true + paths-ignore: + - 'README.md' jobs: - test: + build: runs-on: windows-latest - name: Build & Test + env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + DOTNET_CLI_TELEMETRY_OPTOUT: true + steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 + with: + submodules: true + token: ${{ secrets.OCC_TOKEN }} - name: Setup .NET Core - uses: actions/setup-dotnet@v4 + uses: actions/setup-dotnet@v5 with: - dotnet-version: 8.0.* - - name: Install dependencies + dotnet-version: | + 8.0.* + 10.0.* + + - name: Install Dependencies run: dotnet restore + - name: Build - run: dotnet build -c Release --no-restore - - name: Install Playwright browsers & dependencies - run: pwsh test/OrchardCoreContrib.Testing.UI.Tests/bin/Release/net8.0/playwright.ps1 install --with-deps + run: dotnet build --configuration Release --no-restore + + - name: Install Playwright browsers + shell: pwsh + run: | + $playwrightScripts = Get-ChildItem "test/OrchardCoreContrib.Testing.UI.Tests/bin/Release/*/playwright.ps1" | + Select-Object -ExpandProperty FullName + + if ($null -eq $playwrightScripts -or $playwrightScripts.Count -eq 0) { + throw "Unable to find any playwright.ps1 script in the built UI test output." + } + + foreach ($playwrightScript in $playwrightScripts) { + & $playwrightScript install + } + - name: Test - run: - dotnet test test/OrchardCoreContrib.Testing.UI.Tests -c Release --no-restore --verbosity normal + run: | + dotnet test test/OrchardCoreContrib.Testing.Tests/OrchardCoreContrib.Testing.Tests.csproj --configuration Release --no-build --verbosity normal + dotnet test test/OrchardCoreContrib.Testing.UI.Tests/OrchardCoreContrib.Testing.UI.Tests.csproj --configuration Release --no-build --verbosity normal