-
Notifications
You must be signed in to change notification settings - Fork 44
85 lines (81 loc) · 3.06 KB
/
playwright.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Playwright Tests
on:
push:
branches: [ main ]
paths-ignore:
- '**.md'
- 'tests/**'
pull_request:
branches: [ "*" ]
paths-ignore:
- '**.md'
- 'tests/**'
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
playwright:
#if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
name: 'Playwright Tests'
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Add .NET tools to PATH
run: echo "/github/home/.dotnet/tools" >> $GITHUB_PATH
- name: Install .NET HTTPS Development Certificate
run: |
dotnet tool update -g linux-dev-certs
dotnet linux-dev-certs install
- name: Build .NET Solution
run: dotnet build
- name: Install Playwright Browsers
run: pwsh e2e/SharpSite.E2E/bin/Debug/net9.0/playwright.ps1 install chromium --with-deps
- name: Pull Docker image for Database
run: docker pull postgres:17.2
- name: Run your tests
run: pwsh ./build-and-test.ps1
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
id: test-results
if: always()
with:
files: |
playwright-test-results/**/*.xml
playwright-test-results/**/*.trx
playwright-test-results/**/*.json
- name: Set badge color
if: always()
shell: bash
run: |
case ${{ fromJSON( steps.test-results.outputs.json ).conclusion }} in
success)
echo "BADGE_COLOR=31c653" >> $GITHUB_ENV
;;
failure)
echo "BADGE_COLOR=800000" >> $GITHUB_ENV
;;
neutral)
echo "BADGE_COLOR=696969" >> $GITHUB_ENV
;;
esac
- name: Create badge
if: always()
uses: emibcn/badge-action@808173dd03e2f30c980d03ee49e181626088eee8
with:
label: End-to-end Tests
status: '${{ fromJSON( steps.test-results.outputs.json ).formatted.stats.tests }} tests, ${{ fromJSON( steps.test-results.outputs.json ).formatted.stats.runs }} runs: ${{ fromJSON( steps.test-results.outputs.json ).conclusion }}'
color: ${{ env.BADGE_COLOR }}
path: badge.svg
- name: Upload badge to Azure Blob Storage
if: always() && (github.ref == 'refs/heads/main' || github.base_ref == 'refs/heads/main')
shell: pwsh
run: |
az storage blob upload --account-name $env:AZURE_STORAGE_ACCOUNT --account-key $env:AZURE_STORAGE_KEY --container-name $env:AZURE_STORAGE_CONTAINER --file badge.svg --name playwright-badge.svg --overwrite true
env:
AZURE_STORAGE_ACCOUNT: ${{ secrets.AZURE_STORAGE_ACCOUNT }}
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
AZURE_STORAGE_CONTAINER: ${{ secrets.AZURE_STORAGE_CONTAINER }}