Skip to content

Commit 1895a1b

Browse files
Merge branch 'master' into fixing-4004
2 parents 1493003 + ab61ee7 commit 1895a1b

351 files changed

Lines changed: 11976 additions & 6023 deletions

File tree

Some content is hidden

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

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Feature Request
4+
url: https://github.com/vendurehq/vendure/discussions/new?category=feature-requests
5+
about: Suggest an idea or new feature for Vendure Core
6+
- name: Support Request
7+
url: https://vendure.io/contact?interestedIn=SUPPORT_SERVICES
8+
about: Get professional support for your Vendure project

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/actions/setup/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'Setup Vendure'
2+
description: 'Setup Node with npm cache and install dependencies'
3+
inputs:
4+
node-version:
5+
description: 'Node.js version'
6+
required: false
7+
default: '22.x'
8+
runs:
9+
using: 'composite'
10+
steps:
11+
- uses: actions/setup-node@v4
12+
with:
13+
node-version: ${{ inputs.node-version }}
14+
cache: 'npm'
15+
- name: Install dependencies
16+
shell: bash
17+
run: |
18+
npm install
19+
npm install --os=linux --cpu=x64 sharp

.github/workflows/build_and_test.yml

Lines changed: 185 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ concurrency:
2727
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
2828
cancel-in-progress: true
2929

30+
# NOTE: The Elasticsearch and Redis service definitions are duplicated across the e2e-* jobs
31+
# because GitHub Actions does not support YAML anchors or service definition reuse.
32+
# When updating these services (version bumps, env changes, health checks), update ALL four copies:
33+
# e2e-sqljs, e2e-mariadb, e2e-mysql, e2e-postgres.
3034
jobs:
3135
codegen:
3236
uses: ./.github/workflows/codegen.yml
@@ -35,19 +39,9 @@ jobs:
3539
runs-on: ubuntu-latest
3640
permissions:
3741
contents: read
38-
strategy:
39-
matrix:
40-
node: [20.x, 22.x, 24.x]
4142
steps:
4243
- uses: actions/checkout@v4
43-
- name: Use Node.js ${{ matrix.node }}
44-
uses: actions/setup-node@v4
45-
with:
46-
node-version: ${{ matrix.node }}
47-
- name: npm install
48-
run: |
49-
npm install
50-
npm install --os=linux --cpu=x64 sharp
44+
- uses: ./.github/actions/setup
5145
- name: Build
5246
run: npm run build
5347
unit-tests:
@@ -56,24 +50,113 @@ jobs:
5650
permissions:
5751
contents: read
5852
strategy:
53+
fail-fast: false
5954
matrix:
6055
node: [20.x, 22.x, 24.x]
6156
steps:
6257
- uses: actions/checkout@v4
63-
- name: Use Node.js ${{ matrix.node }}
64-
uses: actions/setup-node@v4
58+
- uses: ./.github/actions/setup
6559
with:
6660
node-version: ${{ matrix.node }}
67-
- name: npm install
68-
run: |
69-
npm install
70-
npm install --os=linux --cpu=x64 sharp
7161
- name: Build
7262
run: npx lerna run ci
7363
- name: Unit tests
7464
run: npm run test
75-
e2e-tests:
76-
name: e2e tests
65+
dashboard-changes:
66+
name: check dashboard changes
67+
runs-on: ubuntu-latest
68+
permissions:
69+
contents: read
70+
outputs:
71+
changed: ${{ steps.check.outputs.changed }}
72+
steps:
73+
- uses: actions/checkout@v4
74+
with:
75+
fetch-depth: 0
76+
- name: Check for dashboard changes
77+
id: check
78+
run: |
79+
base="${{ github.event.pull_request.base.sha }}"
80+
if [ -z "$base" ]; then base="${{ github.event.before }}"; fi
81+
if [ -z "$base" ]; then base="HEAD~1"; fi
82+
if git diff --name-only "$base" HEAD | grep -q '^packages/dashboard/'; then
83+
echo "changed=true" >> "$GITHUB_OUTPUT"
84+
else
85+
echo "changed=false" >> "$GITHUB_OUTPUT"
86+
fi
87+
dashboard-e2e:
88+
name: dashboard e2e
89+
needs: dashboard-changes
90+
if: needs.dashboard-changes.outputs.changed == 'true'
91+
runs-on: ubuntu-latest
92+
permissions:
93+
contents: read
94+
steps:
95+
- uses: actions/checkout@v4
96+
- uses: ./.github/actions/setup
97+
- name: Build
98+
run: npx lerna run ci
99+
- name: Cache Playwright browsers
100+
id: playwright-cache
101+
uses: actions/cache@v4
102+
with:
103+
path: ~/.cache/ms-playwright
104+
key: playwright-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
105+
- name: Install Playwright browsers
106+
if: steps.playwright-cache.outputs.cache-hit != 'true'
107+
run: npx playwright install chromium
108+
working-directory: packages/dashboard
109+
- name: Install Playwright system deps
110+
run: npx playwright install-deps chromium
111+
working-directory: packages/dashboard
112+
- name: Dashboard e2e tests
113+
run: npm run e2e:pw
114+
working-directory: packages/dashboard
115+
e2e-sqljs:
116+
name: e2e (sqljs)
117+
runs-on: ubuntu-latest
118+
permissions:
119+
contents: read
120+
services:
121+
elastic:
122+
image: docker.elastic.co/elasticsearch/elasticsearch:7.1.1
123+
env:
124+
discovery.type: single-node
125+
bootstrap.memory_lock: true
126+
ES_JAVA_OPTS: -Xms512m -Xmx512m
127+
# Elasticsearch will force read-only mode when total available disk space is less than 5%. Since we will
128+
# be running on a shared Azure instance with 84GB SSD, we easily go below 5% available even when there are still
129+
# > 3GB free. So we set this value to an absolute one rather than a percentage to prevent all the Elasticsearch
130+
# e2e tests from failing.
131+
cluster.routing.allocation.disk.watermark.low: 500mb
132+
cluster.routing.allocation.disk.watermark.high: 200mb
133+
cluster.routing.allocation.disk.watermark.flood_stage: 100mb
134+
ports:
135+
- 9200
136+
options: --health-cmd="curl --silent --fail localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=3
137+
redis:
138+
image: redis:7.4.1
139+
ports:
140+
- 6379
141+
strategy:
142+
fail-fast: false
143+
matrix:
144+
node: ${{ github.event_name == 'pull_request' && fromJSON('["22.x"]') || fromJSON('["20.x", "22.x", "24.x"]') }}
145+
steps:
146+
- uses: actions/checkout@v4
147+
- uses: ./.github/actions/setup
148+
with:
149+
node-version: ${{ matrix.node }}
150+
- name: Build
151+
run: npx lerna run ci
152+
- name: e2e tests
153+
env:
154+
E2E_ELASTIC_PORT: ${{ job.services.elastic.ports['9200'] }}
155+
E2E_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
156+
DB: sqljs
157+
run: npm run e2e
158+
e2e-mariadb:
159+
name: e2e (mariadb)
77160
runs-on: ubuntu-latest
78161
permissions:
79162
contents: read
@@ -87,13 +170,93 @@ jobs:
87170
ports:
88171
- 3306
89172
options: --health-cmd="mariadb-admin ping -h localhost -u vendure -ppassword" --health-interval=10s --health-timeout=5s --health-retries=3
173+
elastic:
174+
image: docker.elastic.co/elasticsearch/elasticsearch:7.1.1
175+
env:
176+
discovery.type: single-node
177+
bootstrap.memory_lock: true
178+
ES_JAVA_OPTS: -Xms512m -Xmx512m
179+
cluster.routing.allocation.disk.watermark.low: 500mb
180+
cluster.routing.allocation.disk.watermark.high: 200mb
181+
cluster.routing.allocation.disk.watermark.flood_stage: 100mb
182+
ports:
183+
- 9200
184+
options: --health-cmd="curl --silent --fail localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=3
185+
redis:
186+
image: redis:7.4.1
187+
ports:
188+
- 6379
189+
strategy:
190+
fail-fast: false
191+
matrix:
192+
node: ${{ github.event_name == 'pull_request' && fromJSON('["22.x"]') || fromJSON('["20.x", "22.x", "24.x"]') }}
193+
steps:
194+
- uses: actions/checkout@v4
195+
- uses: ./.github/actions/setup
196+
with:
197+
node-version: ${{ matrix.node }}
198+
- name: Build
199+
run: npx lerna run ci
200+
- name: e2e tests
201+
env:
202+
E2E_MARIADB_PORT: ${{ job.services.mariadb.ports['3306'] }}
203+
E2E_ELASTIC_PORT: ${{ job.services.elastic.ports['9200'] }}
204+
E2E_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
205+
DB: mariadb
206+
run: npm run e2e
207+
e2e-mysql:
208+
name: e2e (mysql)
209+
runs-on: ubuntu-latest
210+
permissions:
211+
contents: read
212+
services:
90213
mysql:
91214
image: vendure/mysql-8-native-auth:latest
92215
env:
93216
MYSQL_ROOT_PASSWORD: password
94217
ports:
95218
- 3306
96219
options: --health-cmd="mysqladmin ping --silent" --health-interval=10s --health-timeout=20s --health-retries=10
220+
elastic:
221+
image: docker.elastic.co/elasticsearch/elasticsearch:7.1.1
222+
env:
223+
discovery.type: single-node
224+
bootstrap.memory_lock: true
225+
ES_JAVA_OPTS: -Xms512m -Xmx512m
226+
cluster.routing.allocation.disk.watermark.low: 500mb
227+
cluster.routing.allocation.disk.watermark.high: 200mb
228+
cluster.routing.allocation.disk.watermark.flood_stage: 100mb
229+
ports:
230+
- 9200
231+
options: --health-cmd="curl --silent --fail localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=3
232+
redis:
233+
image: redis:7.4.1
234+
ports:
235+
- 6379
236+
strategy:
237+
fail-fast: false
238+
matrix:
239+
node: ${{ github.event_name == 'pull_request' && fromJSON('["22.x"]') || fromJSON('["20.x", "22.x", "24.x"]') }}
240+
steps:
241+
- uses: actions/checkout@v4
242+
- uses: ./.github/actions/setup
243+
with:
244+
node-version: ${{ matrix.node }}
245+
- name: Build
246+
run: npx lerna run ci
247+
- name: e2e tests
248+
env:
249+
E2E_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
250+
E2E_ELASTIC_PORT: ${{ job.services.elastic.ports['9200'] }}
251+
E2E_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
252+
DB: mysql
253+
run: npm run e2e
254+
e2e-postgres:
255+
name: e2e (postgres)
256+
runs-on: ubuntu-latest
257+
permissions:
258+
contents: read
259+
services:
97260
postgres:
98261
image: postgres:16
99262
env:
@@ -108,10 +271,6 @@ jobs:
108271
discovery.type: single-node
109272
bootstrap.memory_lock: true
110273
ES_JAVA_OPTS: -Xms512m -Xmx512m
111-
# Elasticsearch will force read-only mode when total available disk space is less than 5%. Since we will
112-
# be running on a shared Azure instance with 84GB SSD, we easily go below 5% available even when there are still
113-
# > 3GB free. So we set this value to an absolute one rather than a percentage to prevent all the Elasticsearch
114-
# e2e tests from failing.
115274
cluster.routing.allocation.disk.watermark.low: 500mb
116275
cluster.routing.allocation.disk.watermark.high: 200mb
117276
cluster.routing.allocation.disk.watermark.flood_stage: 100mb
@@ -125,26 +284,18 @@ jobs:
125284
strategy:
126285
fail-fast: false
127286
matrix:
128-
node: [20.x, 22.x, 24.x]
129-
db: [sqljs, mariadb, mysql, postgres]
287+
node: ${{ github.event_name == 'pull_request' && fromJSON('["22.x"]') || fromJSON('["20.x", "22.x", "24.x"]') }}
130288
steps:
131289
- uses: actions/checkout@v4
132-
- name: Use Node.js ${{ matrix.node }}
133-
uses: actions/setup-node@v4
290+
- uses: ./.github/actions/setup
134291
with:
135292
node-version: ${{ matrix.node }}
136-
- name: npm install
137-
run: |
138-
npm install
139-
npm install --os=linux --cpu=x64 sharp
140293
- name: Build
141294
run: npx lerna run ci
142295
- name: e2e tests
143296
env:
144-
E2E_MYSQL_PORT: ${{ job.services.mysql.ports['3306'] }}
145-
E2E_MARIADB_PORT: ${{ job.services.mariadb.ports['3306'] }}
146297
E2E_POSTGRES_PORT: ${{ job.services.postgres.ports['5432'] }}
147298
E2E_ELASTIC_PORT: ${{ job.services.elastic.ports['9200'] }}
148299
E2E_REDIS_PORT: ${{ job.services.redis.ports['6379'] }}
149-
DB: ${{ matrix.db }}
300+
DB: postgres
150301
run: npm run e2e

.github/workflows/cla.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,18 @@ jobs:
1616
CLAAssistant:
1717
runs-on: ubuntu-latest
1818
steps:
19+
- name: Generate CI Bot Token
20+
id: app-token
21+
uses: actions/create-github-app-token@v2
22+
with:
23+
app-id: ${{ secrets.CI_BOT_APP_ID }}
24+
private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }}
25+
1926
- name: "CLA Assistant"
2027
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
2128
uses: contributor-assistant/github-action@v2.4.0
2229
env:
23-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
2431
with:
2532
path-to-signatures: 'license/signatures/version1/cla.json'
2633
path-to-document: 'https://github.com/vendurehq/vendure/blob/master/license/CLA.md'

.github/workflows/codegen.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
uses: actions/setup-node@v4
1818
with:
1919
node-version: 22
20+
cache: 'npm'
2021
- name: Install dependencies
2122
run: npm install
2223
- name: Build core and common packages

0 commit comments

Comments
 (0)