Repository navigation
77 lines (73 loc) · 2.67 KB
/
Copy pathadmin-jest.yml
File metadata and controls
77 lines (73 loc) · 2.67 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
name: Jest
on:
workflow_call:
inputs:
extensionName:
description: "Your extension name"
required: true
type: string
shopwareVersion:
description: |
With the default `.auto`, the workflow tries to find a shopware version using the shopware-version action.
For example, if the current ref is next-1234, it will try to find the ref next-1234 in shopware/shopware. If there's no matching ref, it will use shopwareVersionFallback
required: false
type: string
default: ".auto"
shopwareVersionFallback:
required: false
type: string
default: trunk
shopware-repository:
description: The shopware repository to checkout
type: string
default: shopware/shopware
composerRootVersion:
required: false
type: string
default: ".auto"
uploadCoverage:
description: "Upload coverage to codecov"
required: false
type: boolean
default: false
secrets:
codecovToken:
description: "Codecov token"
required: false
jobs:
run:
name: Jest
runs-on: ubuntu-latest
steps:
- name: Setup Extension
uses: shopware/github-actions/setup-extension@main
with:
shopwareVersion: ${{ inputs.shopwareVersion }}
shopwareVersionFallback: ${{ inputs.shopwareVersionFallback }}
shopware-repository: ${{ inputs.shopware-repository }}
extensionName: ${{ github.event.repository.name }}
composerRootVersion: ${{ inputs.composerRootVersion }}
install: true
install-admin: true
env: prod
allow-insecure-versions: true
extraRepositories: |
{
"${{ github.event.repository.name }}": {
"type": "path",
"url": "custom/plugins/${{ github.event.repository.name }}",
"symlink": true
}
}
- name: Jest Unit Tests
working-directory: custom/plugins/${{ inputs.extensionName }}/src/Resources/app/administration
run: npm run unit -- --coverage
- name: Upload Coverage
if: inputs.uploadCoverage == true
uses: codecov/codecov-action@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7.1.1
env:
CODECOV_TOKEN: ${{ secrets.codecovToken }}
with:
root_dir: ${{ github.workspace }}/custom/plugins/${{ inputs.extensionName }}
working-directory: ${{ github.workspace }}/custom/plugins/${{ inputs.extensionName }}
directory: ${{ github.workspace }}/custom/plugins/${{ inputs.extensionName }}/src/Resources/app/administration