-
-
Notifications
You must be signed in to change notification settings - Fork 78
339 lines (280 loc) · 10.8 KB
/
components.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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
name: "Components"
on:
push:
branches: 1.x
pull_request:
types: [opened, synchronize]
workflow_dispatch:
schedule:
# Once per day. https://crontab.guru/#*_0_*_*_*
- cron: "* 0 * * *"
- cron: "0 12 * * *"
env:
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
GITHUB_PR_SHA: ${{ github.event.pull_request.head.sha }}
GITHUB_RUN_LOG_URL: https://github.com/opendevshop/devshop/actions/runs/${{ github.run_id }}
GIT_REF: 1.x
jobs:
yaml-tasks:
name: YamlTasks
runs-on: ubuntu-latest
strategy:
matrix:
php-versions:
- '7.4'
- '8.0'
- '8.1'
# Set working directory for entire file. https://github.community/t5/GitHub-Actions/use-working-directory-for-entire-job/td-p/36759
env:
working-directory: ./src/DevShop/Component/YamlTasks
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Get Composer Cache Directory
working-directory: ${{env.working-directory}}
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Validate composer.json and composer.lock
working-directory: ${{env.working-directory}}
run: composer validate
- name: Install dependencies
working-directory: ${{env.working-directory}}
run: |
composer install --prefer-dist --no-progress --no-suggest
- name: Run Yaml Tasks
working-directory: ${{env.working-directory}}
env:
# @TODO: Get environment variable setting to work.
# YAML_TASKS_STATUS_URL: https://github.com/${GITHUB_REPOSITORY}/runs/${GITHUB_RUN_ID}?check_suite_focus=true
GITHUB_TOKEN: ${{ secrets.INPUT_GITHUB_TOKEN }}
PROVISION_PROCESS_OUTPUT: direct
run: |
chmod +x yaml-tasks
./yaml-tasks --dry-run --ansi -v --hostname=github.com --status-url=${GITHUB_RUN_LOG_URL}#step:7:1
./yaml-tasks --dry-run --tasks-file tests.yml --ansi -v --hostname=github.com --status-url=${GITHUB_RUN_LOG_URL}#step:7:1
power-process:
name: PowerProcess
runs-on: ubuntu-latest
strategy:
matrix:
php-versions:
- '7.4'
- '8.0'
- '8.1'
# Set working directory for entire file. https://github.community/t5/GitHub-Actions/use-working-directory-for-entire-job/td-p/36759
env:
working-directory: ./src/DevShop/Component/PowerProcess
steps:
- uses: actions/checkout@v1
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
# extensions: intl #optional
# ini-values: "post_max_size=256M" #optional
- name: Check PHP Version
run: php -v
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Validate composer.json and composer.lock
run: composer validate
working-directory: ${{env.working-directory}}
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
working-directory: ${{env.working-directory}}
- name: Test Power Process
working-directory: ${{env.working-directory}}
run: |
./run composer install --prefer-dist --no-progress --no-suggest
./demo.php
github-api-cli:
name: GitHubApiCli
runs-on: ubuntu-latest
strategy:
matrix:
php-versions:
- '7.4'
- '8.0'
- '8.1'
# Set working directory for entire file. https://github.community/t5/GitHub-Actions/use-working-directory-for-entire-job/td-p/36759
env:
working-directory: ./src/DevShop/Component/GitHubApiCli
steps:
- uses: actions/checkout@v3
# Uncomment this to see deployments in devshop pull requests.
# It gets too noisy run builds on the PR's HEAD commits,
# with:
# ref: ${{ github.event.pull_request.head.ref }}
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
# extensions: intl #optional
# ini-values: "post_max_size=256M" #optional
- name: Check PHP Version
run: php -v
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Validate composer.json and composer.lock
run: composer validate
working-directory: ${{env.working-directory}}
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
working-directory: ${{env.working-directory}}
# - name: Test GitHub Deploy Start
# working-directory: ${{env.working-directory}}
# env:
# GITHUB_TOKEN: ${{ secrets.INPUT_GITHUB_TOKEN }}
# run: |
# ./github deploy:start -n --description="GitHub API CLI tests begun" --environment=${{ matrix.php-versions }}.github.com
# ./github deploy:update -n --state=in_progress
- name: Test GitHub Cli
working-directory: ${{env.working-directory}}
env:
GITHUB_TOKEN: ${{ secrets.INPUT_GITHUB_TOKEN }}
run: |
./github whoami
# - name: Test GitHub Deploy Success
# working-directory: ${{env.working-directory}}
# env:
# GITHUB_TOKEN: ${{ secrets.INPUT_GITHUB_TOKEN }}
# run: |
# ./github deploy:update -n --state=success
GitTraits:
name: GitTraits
runs-on: ubuntu-latest
strategy:
matrix:
php-versions:
- '7.4'
- '8.0'
- '8.1'
# Set working directory for entire file. https://github.community/t5/GitHub-Actions/use-working-directory-for-entire-job/td-p/36759
env:
working-directory: ./src/DevShop/Component/GitTraits
steps:
- uses: actions/checkout@v1
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
# extensions: intl #optional
# ini-values: "post_max_size=256M" #optional
- name: Check PHP Version
run: php -v
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Validate composer.json and composer.lock
run: composer validate
working-directory: ${{env.working-directory}}
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
working-directory: ${{env.working-directory}}
- name: Test
working-directory: ${{env.working-directory}}
env:
GITHUB_TOKEN: ${{ secrets.INPUT_GITHUB_TOKEN }}
run: |
./Tests/repo-info.php
ControlProject:
name: ControlProject
runs-on: ubuntu-latest
strategy:
matrix:
php-versions:
- '7.4'
- '8.0'
- '8.1'
env:
working-directory: ./src/DevShop/Component/ControlProject
devmaster-directory: ../../../devmaster
steps:
# By default, actions/checkout uses the current SHA for the branch it is testing. See on.push.branches: 1.x
# https://github.com/opendevshop/devshop/runs/1517209717?check_suite_focus=true#step:2:465
# For Pull Requests, actions/checkout will use a Merge SHA by default.
# This code sets ref to the PR head SHA instead, so it matches what developers see.
- name: Check Out Sourcecode
uses: actions/checkout@v2
if: github.event_name!='pull_request'
# Fetch all branches and tags so composer can resolve the version.
- name: Check Out Pull Request Sourcecode
uses: actions/checkout@v2
if: github.event_name=='pull_request'
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Prepare Pull Request-only environment
if: github.event_name=='pull_request'
run: |
echo "GIT_REF=${{ github.head_ref }}" >> $GITHUB_ENV
git switch --create ${{ github.head_ref }}
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
# extensions: intl #optional
# ini-values: "post_max_size=256M" #optional
- name: Check PHP Version
run: php -v
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Validate composer.json and composer.lock
run: composer validate
working-directory: ${{env.working-directory}}
# If installing without a lockfile, composer suggests using "update" command instead.
- name: Install dependencies
# Match the command in ./roles/opendevshop.devshop/tasks/main.yml
run: |
composer config repositories.devmaster path ${GITHUB_WORKSPACE}/devmaster
composer require devshop/devmaster:${GIT_REF}-dev
composer install --no-dev --no-progress --prefer-source
working-directory: ${{env.working-directory}}
- name: Test Project Creation
working-directory: ./src/DevShop/Component/
run: |
composer create-project devshop/control-project:@dev temp --repository='{"type":"path","url":"ControlProject"}'
# @TODO: Launch a devshop test container around this devshop-control code.