Skip to content

Commit 3e28771

Browse files
authored
Merge branch 'main' into feat-multi-select-native-select-styling-new
2 parents 5afda6f + 759e9a1 commit 3e28771

File tree

209 files changed

+2157
-936
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+2157
-936
lines changed

.config/.jscpd.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"**/test-results/**",
3636
"**/tests/**",
3737
"**/tsconfig.json",
38+
"**/e2e/**/*.spec.ts",
3839
"packages/components/scripts/post-build/components.ts",
3940
"packages/components/src/components/**/*.spec.tsx",
4041
"packages/components/src/components/**/index.html",

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,35 @@ body:
6666
label: Add any other context about the problem here.
6767
validations:
6868
required: false
69+
70+
- type: dropdown
71+
id: businessunit
72+
attributes:
73+
label: Which DB business unit do you work for?
74+
options:
75+
- DB Systel GmbH (please name your customer below)
76+
- DB Fernverkehr AG
77+
- DB Regio AG
78+
- DB InfraGO AG
79+
- DB Cargo AG
80+
- DB Konzern
81+
- DB Vertrieb GmbH
82+
- DB Energie
83+
- DB Connect
84+
- other (please specify below)
85+
validations:
86+
required: false
87+
88+
- type: input
89+
id: businessunit2
90+
attributes:
91+
label: ”DB Systel” please enter your customer / ”other” please enter your area or business unit.
92+
validations:
93+
required: false
94+
95+
- type: input
96+
id: project
97+
attributes:
98+
label: What project are you working on?
99+
validations:
100+
required: false

.github/actions/auto-commit/action.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,27 @@ inputs:
2424
runs:
2525
using: "composite"
2626
steps:
27-
# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow
28-
- name: 🧬 Generate a token
29-
id: generate-token
30-
uses: actions/create-github-app-token@v2
31-
with:
32-
app-id: ${{ inputs.auto-merge-app-id }}
33-
private-key: ${{ inputs.auto-merge-private-key }}
27+
- name: 🚦 Check for changes before committing
28+
id: check_changes
29+
shell: bash
30+
run: |
31+
if [[ -z "$(git status --porcelain)" ]]; then
32+
echo "No changes to commit. Skipping auto-commit step."
33+
echo "changes_detected=false" >> $GITHUB_ENV
34+
else
35+
echo "Changes detected. Proceeding with creating a new branch and commit changes."
36+
echo "changes_detected=true" >> $GITHUB_ENV
37+
fi
3438
3539
- name: 🏗️ Create new branch and commit changes
40+
if: env.changes_detected == 'true'
3641
shell: bash
3742
env:
3843
GH_TOKEN: ${{ inputs.gh-token }}
3944
NEW_PR_BRANCH: ${{ inputs.branch-name }}
4045
COMMIT_MESSAGE: ${{ inputs.commit-message }}
4146
COMMIT_FILES: ${{ inputs.commit-files }}
47+
HUSKY: 0 # Disable Husky hooks in CI
4248
run: |
4349
git config --global user.name "github-actions[bot]"
4450
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
@@ -47,10 +53,11 @@ runs:
4753
git add $COMMIT_FILES
4854
4955
# We can't use semantic commits here because of the if statement in the workflow
50-
git commit --no-verify --message "$COMMIT_MESSAGE"
56+
git commit --message "$COMMIT_MESSAGE"
5157
git push --force origin "$NEW_PR_BRANCH"
5258
5359
- name: 🪗 Create Pull Request
60+
if: env.changes_detected == 'true'
5461
shell: bash
5562
env:
5663
GH_TOKEN: ${{ inputs.gh-token }}
@@ -60,7 +67,17 @@ runs:
6067
run: |
6168
gh pr create --base "$BASE_BRANCH" --head "$NEW_PR_BRANCH" --title "Automated PR: $COMMIT_MESSAGE" --body "This PR was created automatically by a GitHub Action."
6269
70+
# https://docs.github.com/en/apps/creating-github-apps/authenticating-with-a-github-app/making-authenticated-api-requests-with-a-github-app-in-a-github-actions-workflow
71+
- name: 🧬 Generate a token
72+
if: env.changes_detected == 'true'
73+
id: generate-token
74+
uses: actions/create-github-app-token@v2
75+
with:
76+
app-id: ${{ inputs.auto-merge-app-id }}
77+
private-key: ${{ inputs.auto-merge-private-key }}
78+
6379
- name: 🤖 Squash the PR
80+
if: env.changes_detected == 'true'
6481
shell: bash
6582
run: gh pr merge --squash "$NEW_PR_BRANCH"
6683
env:

.github/actions/npm-cache/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ inputs:
1313
nodeVersion:
1414
description: "Node version"
1515
required: false
16-
default: "24"
1716
runs:
1817
using: "composite"
1918
steps:
@@ -22,7 +21,9 @@ runs:
2221
# https://github.com/actions/setup-node
2322
uses: actions/setup-node@v4
2423
with:
24+
# If node-version and node-version-file are both provided the action will use version from node-version.
2525
node-version: ${{ inputs.nodeVersion }}
26+
node-version-file: ".nvmrc"
2627

2728
- name: 🖼️ Display node and npm version
2829
shell: bash
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: 🎭 Playwright E2E
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
required: true
8+
type: string
9+
path:
10+
required: false
11+
type: string
12+
13+
permissions:
14+
actions: write
15+
contents: write
16+
17+
jobs:
18+
playwright-patternhub:
19+
name: 🧪🎭 - patternhub
20+
runs-on: ubuntu-24.04 # Use Ubuntu 24.04 explicitly
21+
container:
22+
image: mcr.microsoft.com/playwright:v${{ inputs.version }}
23+
options: --user 1001
24+
steps:
25+
- name: ⏬ Checkout repo
26+
uses: actions/checkout@v4
27+
28+
- name: 🔄 Init Cache
29+
uses: ./.github/actions/npm-cache
30+
31+
- name: ⏬ Download foundations build
32+
uses: actions/download-artifact@v4
33+
with:
34+
name: db-ux-foundations-build
35+
path: packages/foundations/build
36+
37+
- name: ⏬ Download output
38+
uses: actions/download-artifact@v4
39+
with:
40+
name: db-ux-output
41+
path: output
42+
43+
- name: ⏬ Download components styles build
44+
uses: actions/download-artifact@v4
45+
with:
46+
name: db-ux-components-build
47+
path: packages/components/build
48+
49+
- name: ⏬ Download patternhub
50+
uses: actions/download-artifact@v4
51+
with:
52+
name: db-ux-patternhub
53+
path: build-showcases/patternhub
54+
55+
# We test everything for patternhub and main branch
56+
- name: 👩‍🔬 Test showcase with Playwright 🎭
57+
shell: bash
58+
env:
59+
NEXT_PUBLIC_BASE_PATH: ${{ inputs.path }}
60+
run: |
61+
mkdir -p ./build-showcases${{ inputs.path }}
62+
cp -RT ./build-showcases/patternhub ./build-showcases${{ inputs.path }}
63+
npm run test:e2e --workspace=patternhub
64+
65+
- name: 🔣 Print GitHub Report
66+
if: failure()
67+
shell: bash
68+
run: |
69+
npx playwright merge-reports --reporter github ./blob-report
70+
71+
- name: 🆙 Upload test results
72+
if: failure()
73+
uses: actions/upload-artifact@v4
74+
with:
75+
name: patternhub-playwright-results
76+
path: ./showcases/patternhub/test-results
77+
retention-days: 30

.github/workflows/02-e2e-regenerate.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ jobs:
7878
cp --recursive --no-target-directory ./build-showcases/${{ inputs.type }} ./build-showcases${{ inputs.path }}
7979
npm run regenerate:screenshots --workspace=patternhub
8080
else
81-
npm run regenerate:screenshots --workspace=react-showcase
81+
npm run regenerate:visual-snapshots --workspace=react-showcase
82+
npm run regenerate:aria-snapshots --workspace=react-showcase
8283
fi
8384
8485
- name: 🆙 Upload components

.github/workflows/02-e2e-showcases.yml

Lines changed: 56 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ on:
99
showcase:
1010
required: true
1111
type: string
12-
path:
13-
required: false
14-
type: string
12+
outputs:
13+
aria-snapshots-changed:
14+
description: "If aria snapshots changed in current PR"
15+
value: ${{ jobs.playwright-showcases.outputs.aria-snapshots-changed }}
16+
aria-snapshots-changed-to-main:
17+
description: "If aria snapshots changed to main branch"
18+
value: ${{ jobs.playwright-showcases.outputs.aria-snapshots-changed-to-main }}
19+
visual-snapshots-changed:
20+
description: "If visual snapshots changed"
21+
value: ${{ jobs.playwright-showcases.outputs.visual-snapshots-changed }}
1522

1623
permissions:
1724
actions: write
@@ -27,11 +34,18 @@ jobs:
2734
strategy:
2835
fail-fast: false
2936
matrix:
30-
shardIndex: [1, 2, 3, 4, 5, 6]
31-
shardTotal: [6]
37+
shardIndex: [1, 2, 3, 4]
38+
shardTotal: [4]
39+
outputs:
40+
aria-snapshots-changed: ${{ steps.aria-snapshots.outputs.aria-snapshots-changed }}
41+
aria-snapshots-changed-to-main: ${{ steps.aria-snapshots.outputs.aria-snapshots-changed-to-main }}
42+
visual-snapshots-changed: ${{ steps.visual-snapshots.outputs.visual-snapshots-changed }}
3243
steps:
3344
- name: ⏬ Checkout repo
3445
uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 0 # fetch all history for all branches
48+
fetch-tags: false
3549

3650
- name: 🔄 Init Cache
3751
uses: ./.github/actions/npm-cache
@@ -60,21 +74,50 @@ jobs:
6074
name: db-ux-${{ inputs.showcase }}
6175
path: build-showcases/${{ inputs.showcase }}
6276

63-
- name: 🧴 Copy patternhub testing app
64-
if: inputs.path
65-
shell: bash
66-
run: |
67-
mkdir --parents ./build-showcases${{ inputs.path }}
68-
cp --recursive --no-target-directory ./build-showcases/${{ inputs.showcase }} ./build-showcases${{ inputs.path }}
69-
77+
# We test everything for patternhub and main branch
7078
- name: 👩‍🔬 Test showcase with Playwright 🎭
7179
shell: bash
80+
if: github.event.pull_request == null
7281
env:
7382
NEXT_PUBLIC_BASE_PATH: ${{ inputs.path }}
7483
run: |
75-
ls ./build-showcases${{ inputs.path }}
7684
npm run test:e2e --workspace=${{ inputs.showcase }} -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
7785
86+
# We check if aria-snapshots were changed
87+
- name: 👩‍🔬 Test aria-snapshots with Playwright 🎭
88+
id: aria-snapshots
89+
shell: bash
90+
if: github.event.pull_request != null
91+
run: |
92+
npm run test:aria-snapshots --workspace=${{ inputs.showcase }} -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --update-snapshots
93+
OUTPUT=$(npx --no tsx scripts/github/snapshot-changes/check-aria.ts)
94+
echo "aria-snapshots-changed=$OUTPUT" >> $GITHUB_OUTPUT
95+
OUTPUT=$(npx --no tsx scripts/github/snapshot-changes/check-main-aria.ts)
96+
echo "aria-snapshots-changed-to-main=$OUTPUT" >> $GITHUB_OUTPUT
97+
98+
- name: 👩‍🔬 Test axe-core with Playwright 🎭
99+
shell: bash
100+
if: github.event.pull_request != null
101+
run: |
102+
npm run test:axe-core --workspace=${{ inputs.showcase }} -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
103+
104+
- name: 👩‍🔬 Test visual-snapshots with Playwright 🎭
105+
id: visual-snapshots
106+
shell: bash
107+
if: github.event.pull_request != null
108+
run: |
109+
npm run test:visual-snapshots --workspace=${{ inputs.showcase }} -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }} --update-snapshots
110+
OUTPUT=$(npx --no tsx scripts/github/snapshot-changes/check-visual.ts)
111+
echo "visual-snapshots-changed=$OUTPUT" >> $GITHUB_OUTPUT
112+
113+
- name: 👩‍🔬 Test a11y-checker with Playwright 🎭
114+
shell: bash
115+
if: |
116+
github.event.pull_request != null &&
117+
steps.aria-snapshots.outputs.aria-snapshots-changed-to-main=='true'
118+
run: |
119+
npm run test:a11y-checker --workspace=${{ inputs.showcase }} -- --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
120+
78121
- name: 🔣 Print GitHub Report
79122
if: failure()
80123
shell: bash
@@ -88,11 +131,3 @@ jobs:
88131
name: ${{ inputs.showcase }}-playwright-results-${{ matrix.shardIndex }}
89132
path: ./showcases/${{ inputs.showcase }}/test-results
90133
retention-days: 30
91-
92-
- name: 🆙 Upload aChecker results
93-
if: failure()
94-
uses: actions/upload-artifact@v4
95-
with:
96-
name: ${{ inputs.showcase }}-showcase-achecker-results-${{ matrix.shardIndex }}
97-
path: ./showcases/${{ inputs.showcase }}-showcase/results
98-
retention-days: 30

.github/workflows/99-self-healing-dependabot-updates.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ jobs:
2121
id: check_pr
2222
run: |
2323
echo "PR title: ${{ github.event.pull_request.title }}"
24-
if [[ "${{ github.event.pull_request.title }}" =~ "bump stylelint from" ]]; then
24+
if [[ "${{ github.event.pull_request.title }}" =~ "bump stylelint from" ]] || [[ "${{ github.event.pull_request.title }}" =~ "bump the stylelint group with" ]]; then
2525
echo "Stylelint update detected."
2626
echo "stylelint_update=true" >> $GITHUB_ENV
27-
elif [[ "${{ github.event.pull_request.title }}" =~ "bump prettier from" ]]; then
27+
elif [[ "${{ github.event.pull_request.title }}" =~ "bump prettier from" ]] || [[ "${{ github.event.pull_request.title }}" =~ "bump the prettier group with" ]]; then
2828
echo "Prettier update detected."
2929
echo "prettier_update=true" >> $GITHUB_ENV
3030
else
31-
echo "No Stylelint or prettier updates detected."
31+
echo "No Stylelint or Prettier updates detected."
3232
fi
3333
3434
- name: 🆙 Set up Node.js

.github/workflows/default.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,11 @@ jobs:
143143
showcase: vue-showcase
144144

145145
test-showcase-patternhub:
146-
uses: ./.github/workflows/02-e2e-showcases.yml
146+
uses: ./.github/workflows/02-e2e-patternhub.yml
147147
needs: [build-showcase-patternhub, get-playwright-version]
148148
with:
149149
version: ${{ needs.get-playwright-version.outputs.version }}
150150
path: ${{ needs.build-showcase-patternhub.outputs.path }}
151-
showcase: patternhub
152151

153152
regenerate-snapshots-components:
154153
if: always() && needs.test-components.result == 'failure'
@@ -180,14 +179,24 @@ jobs:
180179
get-playwright-version
181180
]
182181

182+
# This job runs only if aria-snapshots were changed compared to main or if it runs on main branch
183183
test-screen-reader:
184+
if: |
185+
needs.test-showcase-react.outputs.aria-snapshots-changed-to-main == 'true' ||
186+
github.event.pull_request == null
184187
uses: ./.github/workflows/02-e2e-screen-reader.yml
185-
needs: [build-showcase-react, init-playwright, get-playwright-version]
188+
needs: [test-showcase-react, init-playwright, get-playwright-version]
186189
with:
187190
version: ${{ needs.get-playwright-version.outputs.version }}
188191

189192
regenerate-snapshots:
190-
if: always() && (needs.test-showcase-angular.result == 'failure' || needs.test-showcase-react.result == 'failure' || needs.test-showcase-vue.result == 'failure')
193+
if: |
194+
needs.test-showcase-angular.outputs.aria-snapshots-changed == 'true' ||
195+
needs.test-showcase-angular.outputs.visual-snapshots-changed == 'true' ||
196+
needs.test-showcase-react.outputs.aria-snapshots-changed == 'true' ||
197+
needs.test-showcase-react.outputs.visual-snapshots-changed == 'true' ||
198+
needs.test-showcase-vue.outputs.aria-snapshots-changed == 'true' ||
199+
needs.test-showcase-vue.outputs.visual-snapshots-changed == 'true'
191200
uses: ./.github/workflows/02-e2e-regenerate.yml
192201
with:
193202
version: ${{ needs.get-playwright-version.outputs.version }}
@@ -241,7 +250,7 @@ jobs:
241250
resultTestShowcasePatternhub="${{ needs.test-showcase-patternhub.result }}"
242251
resultTestScreenReader="${{ needs.test-screen-reader.result }}"
243252
if [[ $resultTestFoundations == "success" ]] && \
244-
[[ $resultTestScreenReader == "success" ]] && \
253+
[[ $resultTestScreenReader == "success" || $resultTestScreenReader == "skipped" ]] && \
245254
[[ $resultTestShowcaseStencil == "success" ]] && \
246255
[[ $resultTestShowcaseAngular == "success" ]] && \
247256
[[ $resultTestShowcaseReact == "success" ]] && \

0 commit comments

Comments
 (0)