forked from shopware/shopware
-
Notifications
You must be signed in to change notification settings - Fork 0
120 lines (110 loc) · 3.81 KB
/
admin.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
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
name: Admin checks and tests
on:
pull_request:
workflow_dispatch:
workflow_call:
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 'true'
COMPOSER_ROOT_VERSION: 6.6.9999999-dev
jobs:
lint:
runs-on: ubuntu-24.04
steps:
- name: Setup Shopware
uses: shopware/setup-shopware@main
with:
install-admin: true
shopware-version: ${{ github.ref }}
shopware-repository: ${{ github.repository }}
- name: Cache ESLint and Stylelint
uses: actions/cache@v4
with:
path: |
src/Administration/Resources/app/administration/node_modules/.eslintcache
src/Administration/Resources/app/administration/node_modules/.stylelintcache
key: admin-lint-${{ runner.os }}-6.6
- name: Lint
working-directory: src/Administration/Resources/app/administration
run: npm run lint
- name: Lint types
working-directory: src/Administration/Resources/app/administration
run: npm run lint:types
- name: Lint scss
working-directory: src/Administration/Resources/app/administration
run: npm run lint:scss
admin:
runs-on: ubuntu-24.04
name: "Jest Admin"
strategy:
matrix:
test-type:
- unit
- unit:disabled-compat
env:
APP_ENV: prod
DATABASE_URL: mysql://root:root@database:3306/root
APP_URL: http://localhost:8000
APP_SECRET: def00000bb5acb32b54ff8ee130270586eec0e878f7337dc7a837acc31d3ff00f93a56b595448b4b29664847dd51991b3314ff65aeeeb761a133b0ec0e070433bff08e48
OPENSEARCH_URL: elasticsearch:9200
BLUE_GREEN_DEPLOYMENT: 1
steps:
- name: Setup Shopware
uses: shopware/setup-shopware@main
with:
install-admin: true
shopware-version: ${{ github.ref }}
shopware-repository: ${{ github.repository }}
- name: Run Jest Admin ${{ matrix.test-type }}
run: npm --prefix src/Administration/Resources/app/administration run ${{ matrix.test-type }} -- --silent
- name: Upload coverage
uses: codecov/codecov-action@v5
if: ${{ matrix.test-type == 'unit' }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: build/artifacts/jest/cobertura-coverage.xml
flags: jest-admin
license-check:
runs-on: ubuntu-24.04
name: "License check"
env:
WHITELISTED_JS_PACKAGES: '[email protected];administration;[email protected]'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: package*.json changed
id: changed-package-json
uses: tj-actions/changed-files@v45
with:
files: src/Administration/Resources/app/administration/package*.json
- uses: actions/setup-node@v4
if: steps.changed-package-json.outputs.any_changed == 'true'
with:
node-version: 20
- name: install packages
if: steps.changed-package-json.outputs.any_changed == 'true'
working-directory: src/Storefront/Resources/app/storefront
run: |
npm ci
- name: Check license
if: steps.changed-package-json.outputs.any_changed == 'true'
working-directory: src/Administration/Resources/app/administration
run: |
npx license-checker-rseidelsohn \
--onlyAllow "$(tr \\n \; < ${{ github.workspace }}/.allowed-licenses)" \
--excludePackages "${WHITELISTED_JS_PACKAGES}" \
--excludePrivatePackages
admin-check:
if: always()
needs:
- lint
- admin
- license-check
runs-on: Ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
# allowed-failures: docs, linters
# allowed-skips: non-voting-flaky-job
jobs: ${{ toJSON(needs) }}