Repository navigation
87 lines (77 loc) · 3.14 KB
/
Copy paththeme.yml
File metadata and controls
87 lines (77 loc) · 3.14 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
name: Theme
on:
workflow_call:
defaults:
run:
shell: bash
jobs:
build:
name: Build Theme
runs-on: ${{ (github.event.act || !github.event.repository.private) && 'ubuntu-latest' || format('runs-on={0}/runner=sw-amd64', github.run_id) }}
steps:
- uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Build Theme
uses: shopware/github-actions/build-zip@main
env:
NODE_OPTIONS: "--openssl-legacy-provider"
with:
extensionName: '${{ github.event.repository.name }}'
install:
name: Test Theme installation
runs-on: ${{ (github.event.act || !github.event.repository.private) && 'ubuntu-latest' || format('runs-on={0}/runner=sw-amd64', github.run_id) }}
needs:
- build
services:
mysql:
image: mysql:8.0
env:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes'
MYSQL_DATABASE: shopware
ports:
- 3306:3306
options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3
volumes:
- /dev/shm/mysql:/var/lib/mysql
steps:
- uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0
- name: Setup and Install Theme
uses: shopware/github-actions/setup-extension@main
with:
mysqlVersion: 'skip'
install: 'true'
env: 'prod'
extensionName: '${{ github.event.repository.name }}'
extension-zip: '${{ github.event.repository.name }}.zip'
- name: Validate Snippets
run: |-
bin/console snippets:validate
should_test_jest:
name: Determine whether to run Jest tests
runs-on: ${{ (github.event.act || !github.event.repository.private) && 'ubuntu-latest' || format('runs-on={0}/runner=sw-amd64', github.run_id) }}
outputs:
test_jest: ${{ steps.should_run.outputs.test_jest }}
steps:
- uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Determine whether to run Jest tests
id: should_run
run: |-
echo "test_jest=${{ hashFiles('Resources/app/storefront/package-lock.json') != '' && hashFiles('Resources/app/storefront/jest.config.*') != '' }}" >> ${GITHUB_OUTPUT}
test_jest:
name: Unit tests (Jest)
runs-on: ${{ (github.event.act || !github.event.repository.private) && 'ubuntu-latest' || format('runs-on={0}/runner=sw-amd64', github.run_id) }}
needs:
- should_test_jest
if: ${{ needs.should_test_jest.outputs.test_jest == 'true' }}
env:
STOREFRONT_PATH: "Resources/app/storefront"
steps:
- uses: runs-on/action@17b59092eb37ebfdbb034460892887c09100eaa3 # v2.5.0
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Execute Jest tests
working-directory: ${{ env.STOREFRONT_PATH }}
run: |-
npm ci --no-audit --prefer-offline
# shellcheck disable=SC2046
$(npm bin)/jest --config jest.config.js --ci