Further fix for #254 #314
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: .NET CI | |
| on: | |
| push: | |
| branches: [ "master" ] | |
| pull_request: | |
| branches: [ "master" ] | |
| jobs: | |
| build_and_test: | |
| name: Build & test | |
| runs-on: ubuntu-24.04 | |
| timeout-minutes: 30 | |
| env: | |
| RunNumber: ${{ github.run_number }}.${{ github.run_attempt }} | |
| Configuration: Debug | |
| Tfm: net8.0 | |
| # Change selected factory to VerboseChrome to debug Chrome-related issues | |
| WebDriverFactory__SelectedConfiguration: CiHeadlessChrome | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Setup build dependencies | |
| uses: ./.github/actions/setup-build-dependencies | |
| - name: Setup additional test dependencies | |
| uses: ./.github/actions/setup-test-dependencies | |
| - name: Restore third party libs | |
| uses: ./.github/actions/restore-dependencies | |
| - name: Start SonarScanner | |
| uses: ./.github/actions/start-sonarscanner | |
| with: | |
| project: csf-dev_CSF.Screenplay | |
| build-version: GitHub_build_${{ env.RunNumber }} | |
| username: craigfowler-github | |
| secret-key: ${{ secrets.SONARCLOUDKEY }} | |
| js-coverage-path: CSF.Screenplay.JsonToHtmlReport.Template/src/TestResults/lcov.info | |
| - name: Build the solution | |
| run: dotnet build -c ${{ env.Configuration }} --no-incremental | |
| - id: run-all-tests | |
| name: Run all tests, with coverage | |
| uses: ./.github/actions/run-all-tests-with-coverage | |
| with: | |
| tfm: ${{ env.Tfm }} | |
| - name: Stop SonarScanner | |
| run: | |
| dotnet sonarscanner end /d:sonar.token=${{ secrets.SONARCLOUDKEY }} | |
| - name: Gracefully stop Xvfb | |
| run: killall Xvfb | |
| continue-on-error: true | |
| - name: Upload all CI artifacts | |
| uses: ./.github/actions/upload-ci-artifacts | |
| with: | |
| tfm: ${{ env.Tfm }} | |
| - name: Fail the build if any test failures | |
| if: ${{ steps.run-all-tests.outputs.failures == 'true' }} | |
| run: | | |
| echo "Failing the build due to test failures" | |
| exit 1 |