1- # Run when commits are pushed to main
1+ name : Default
2+
23on :
3- workflow_dispatch :
44 pull_request :
55 types : [opened, synchronize, reopened, closed]
66 branches :
77 - main
88 push :
99 branches :
1010 - main
11+ workflow_dispatch :
12+
13+ run-name : Deploy to ${{ inputs.deploy_target }} by @${{ github.actor }}
1114
1215# Set up permissions for deploying with secretless Azure federated credentials
1316# https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-portal%2Clinux#set-up-azure-login-with-openid-connect-authentication
1417permissions :
1518 id-token : write
1619 contents : read
20+ pull-requests : write
1721
1822concurrency :
1923 group : ${{ github.workflow }}-${{ github.ref }}
4751 run : pnpm install --frozen-lockfile
4852
4953 - name : Install Playwright Browsers
50- run : pnpx playwright install --with-deps
54+ run : pnpm exec playwright install --with-deps
55+ working-directory : Sandbox.EndToEndTests
5156
5257 - name : Install SOPS
5358 run : |
6772 run : dotnet build
6873
6974 - name : Run .NET tests
70- run : dotnet test --no-build
75+ run : dotnet test --no-build -- --coverage --coverage-output coverage.xml --coverage-output-format cobertura --coverage-settings "../coverage.config"
76+
77+ - name : ReportGenerator
78+ uses :
danielpalme/[email protected] 79+ with :
80+ reports : ' **/coverage.xml'
81+ targetdir : ' coveragereport'
82+ reporttypes : ' HtmlInline;Cobertura;MarkdownSummaryGithub'
83+ tag : ' ${{ github.run_number }}_${{ github.run_id }}'
84+ customSettings : ' minimumCoverageThresholds:lineCoverage=70'
85+
86+ - name : Upload .NET coverage report artifact
87+ uses : actions/upload-artifact@v4
88+ if : ${{ !cancelled() }}
89+ with :
90+ name : CoverageReport
91+ path : coveragereport
92+
93+ - name : Add comment to PR
94+ if : github.event_name == 'pull_request'
95+ run : gh pr comment $PR_NUMBER --edit-last --create-if-none --body-file coveragereport/SummaryGithub.md
96+ env :
97+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
98+ PR_NUMBER : ${{ github.event.number }}
99+
100+ - name : Publish coverage in build summary
101+ run : cat coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY
102+ shell : bash
71103
72104 - name : Build Angular workspace
73105 run : pnpm --filter="sandbox.angular-workspace" build
@@ -79,17 +111,18 @@ jobs:
79111 run : pnpm --filter="!sandbox.e2e" test
80112
81113 - name : E2E test frontend projects
82- run : DEBUG=pw:webserver pnpm --filter="sandbox.e2e" test
114+ run : pnpm --filter="sandbox.e2e" test
83115 env :
84116 PLAYWRIGHT_USERNAME : ${{ secrets.PLAYWRIGHT_USERNAME }}
85117 PLAYWRIGHT_PASSWORD : ${{ secrets.PLAYWRIGHT_PASSWORD }}
118+ APPLICATION_URL : ${{ secrets.APPLICATION_URL }}
86119
87- - name : 📦 Upload Test Results Artifact
120+ - name : Upload E2E Results Artifact
88121 uses : actions/upload-artifact@v4
89- if : always()
122+ if : ${{ !cancelled() }}
90123 with :
91- name : playwright-test-results
92- path : playwright-report
124+ name : playwright-report
125+ path : ./Sandbox.EndToEndTests/ playwright-report/
93126
94127 release :
95128 runs-on : ubuntu-latest
0 commit comments