-
Notifications
You must be signed in to change notification settings - Fork 3
167 lines (141 loc) · 4.16 KB
/
ci_pipe.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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
name: CI Pipeline
on:
push:
branches:
- main
workflow_dispatch:
branches:
- main
pull_request:
branches:
- main
jobs:
install_dev:
name: Install Dev Dependencies
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# -----------------------------------
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
# -----------------------------------
- name: Mount Dev Dependency Cache
uses: actions/cache@v4
with:
key: cache-dev-dependencies-${{ github.run_id }}
path: |
vendor
# -----------------------------------
- name: Install Dependencies
run: make dev -B
# ------------------------------------------------------------------------------------------------------------------------
syntax_checks:
name: Syntax Checks
needs: install_dev
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# -----------------------------------
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
# -----------------------------------
- name: PHP Syntax Checks
run: make phpcheck -B
phpunit:
name: PHPUnit
needs: install_dev
runs-on: ubuntu-latest
steps:
- name: Clone Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Mount Dev Dependency Cache
uses: actions/cache@v4
with:
key: cache-dev-dependencies-${{ github.run_id }}
path: |
vendor
- name: Run PHPUnit
run: make phpunit -B
phpstan:
name: PHPStan
needs: install_dev
runs-on: ubuntu-latest
steps:
- name: Clone Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Mount Dev Dependency Cache
uses: actions/cache@v4
with:
key: cache-dev-dependencies-${{ github.run_id }}
path: |
vendor
- name: Run PHPStan
run: make stan -B
csfixer:
name: CS Fixer
needs: install_dev
runs-on: ubuntu-latest
steps:
- name: Clone Code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- name: Mount Dev Dependency Cache
uses: actions/cache@v4
with:
key: cache-dev-dependencies-${{ github.run_id }}
path: |
vendor
- name: Run CS Fixer
run: make csfix -B
# ------------------------------------------------------------------------------------------------------------------------
build:
name: Build ZIP File
runs-on: ubuntu-latest
needs: [ syntax_checks, phpunit, phpstan, csfixer ]
steps:
- name: Clone Code
uses: actions/checkout@v4
- name: Build ZIP File
run: |
make release -B
- name: Extract ZIP file for artifact
shell: bash
run: |
unzip ./.build/AIDemoData.zip -d ./.build/extension
- name: Store ZIP file in Github
uses: actions/upload-artifact@v4
with:
name: AIDemoData
retention-days: 4
path: ./.build/extension
- name: Delete TMP files
shell: bash
run: |
rm -rf ./.build/extension
# ------------------------------------------------------------------------------------------------------------------------
packagist:
name: Update Packagist
runs-on: ubuntu-latest
needs: [ build ]
steps:
# -----------------------------------
- uses: actions/checkout@v4
# -----------------------------------
- name: Invoke Packagist Webhook
run: |
curl -XPOST -H'content-type:application/json' 'https://packagist.org/api/update-package?username=${{ secrets.PACKAGIST_USER }}&apiToken=${{ secrets.PACKAGIST_TOKEN }}' -d'{"repository":{"url":"https://packagist.org/packages/boxblinkracer/shopware-ai-demodata"}}'