-
-
Notifications
You must be signed in to change notification settings - Fork 10
140 lines (119 loc) · 4.23 KB
/
Copy pathci-tests.yml
File metadata and controls
140 lines (119 loc) · 4.23 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Run Tests
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
concurrency:
group: ${{ github.workflow }}-testing-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
codecov:
name: Code Coverage (Vitest)
runs-on: ubuntu-latest
env:
NODE_OPTIONS: "--max_old_space_size=4096"
steps:
- name: Check out code using Git
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Install Tools & Dependencies
uses: withstudiocms/automations/.github/actions/install@885437ef4376e64fc295161092b8a165bc5efd39 # main
- name: Build packages
run: pnpm ci:build
- name: Run Tests & Code Coverage
run: pnpm ci:coverage
continue-on-error: ${{ github.event_name == 'pull_request' }}
- name: Upload coverage results to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7
with:
slug: withstudiocms/ui
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f
with:
slug: withstudiocms/ui
token: ${{ secrets.CODECOV_TOKEN }}
playwright:
name: E2E (Playwright)
timeout-minutes: 60
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
steps:
- name: Check out code using Git
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Install Tools & Dependencies
uses: withstudiocms/automations/.github/actions/install@885437ef4376e64fc295161092b8a165bc5efd39 # main
- name: Install Playwright Browsers
run: pnpm ci:setup:playwright
- name: Build Package
run: pnpm ci:build
- name: Run Playwright tests
run: pnpm ci:e2e --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
continue-on-error: true
- name: Upload blob report to GitHub Actions Artifacts
if: ${{ !cancelled() }}
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: blob-report-${{ matrix.shardIndex }}
path: packages/studiocms_ui/blob-report
retention-days: 1
playwright-test-report:
name: E2E Report (Playwright)
if: ${{ !cancelled() }}
needs: [playwright]
permissions:
actions: read
contents: read
pull-requests: write
checks: write
runs-on: ubuntu-latest
steps:
- name: Check out code using Git
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- name: Install Tools & Dependencies
uses: withstudiocms/automations/.github/actions/install@885437ef4376e64fc295161092b8a165bc5efd39 # main
- name: Download blob reports from GitHub Actions Artifacts
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
with:
path: all-blob-reports
pattern: blob-report-*
merge-multiple: true
- name: Merge into HTML Report
run: pnpm exec playwright merge-reports --reporter html,playwright-ctrf-json-reporter ./all-blob-reports
- name: Upload HTML report
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: html-report
path: playwright-report
retention-days: 30
- name: Publish Test Report
uses: ctrf-io/github-test-reporter@646f98cfc16c6f7a0e1f6100cabe2deb95dd2eef # v1
if: always()
with:
report-path: './ctrf/*.json'
pull-request: ${{ github.event_name == 'pull_request' }}
github-report: true
suite-folded-report: true
overwrite-comment: true
use-suite-name: true
report-order: 'github-report,suite-folded-report'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}