Make GHA tests cross-platform #59
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Selenium project tests | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| runner: | |
| description: "Select the runner" | |
| required: false | |
| type: choice | |
| options: | |
| - windows-latest | |
| - ubuntu-latest | |
| default: windows-latest | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| BROWSER_PARAMS: "--window-size=1920,1080 --allowed-ips --no-sandbox" | |
| jobs: | |
| build: | |
| runs-on: ${{ inputs.runner || 'windows-latest' }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '8.0.x' | |
| # Windows Runner | |
| - name: Run Blazor app (Windows) | |
| if: runner.os == 'Windows' | |
| run: | | |
| Start-Job -ScriptBlock { Start-Process -NoNewWindow -FilePath dotnet -ArgumentList "run" -WorkingDirectory ./src/BlazorApp } | |
| Start-Sleep -Seconds 20 | |
| # Ubuntu Runner | |
| - name: Run Blazor app (Ubuntu) | |
| if: runner.os == 'Linux' | |
| run: | | |
| cd ./src/BlazorApp | |
| dotnet run & | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Build | |
| working-directory: ./Behavioral.Automation.Selenium/Behavioral.Automation.DemoScenarios | |
| run: dotnet build -c Release --no-restore | |
| - name: Test | |
| working-directory: ./Behavioral.Automation.Selenium/Behavioral.Automation.DemoScenarios | |
| run: dotnet test -c Release --no-build --verbosity normal | |