-
Notifications
You must be signed in to change notification settings - Fork 16
84 lines (69 loc) · 2.32 KB
/
Copy pathplugins-ci.yml
File metadata and controls
84 lines (69 loc) · 2.32 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
name: Plugins CI
on:
pull_request:
paths:
- 'packages/coinpay-php/**'
- 'plugins/**'
- 'scripts/sync-plugin-sdk.sh'
- 'scripts/build-plugin-zips.sh'
- '.github/workflows/plugins-ci.yml'
push:
branches: [master]
paths:
- 'packages/coinpay-php/**'
- 'plugins/**'
- 'scripts/sync-plugin-sdk.sh'
- 'scripts/build-plugin-zips.sh'
- '.github/workflows/plugins-ci.yml'
workflow_dispatch:
jobs:
lint-and-test:
name: Lint + Test (PHP ${{ matrix.php }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
steps:
- uses: actions/checkout@v5
- uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: curl, hash, json
coverage: none
tools: none
- name: Sync vendored SDK (sanity check)
run: ./scripts/sync-plugin-sdk.sh
- name: Verify vendored copies match source
run: |
diff -r packages/coinpay-php/src plugins/woocommerce/coinpay-woocommerce/lib/CoinPay
diff -r packages/coinpay-php/src plugins/whmcs/modules/gateways/coinpay/lib/CoinPay
- name: PHP syntax check — shared client
run: find packages/coinpay-php/src -name '*.php' -print0 | xargs -0 -n1 php -l
- name: PHP syntax check — WooCommerce plugin
run: find plugins/woocommerce -name '*.php' -print0 | xargs -0 -n1 php -l
- name: PHP syntax check — WHMCS plugin
run: find plugins/whmcs -name '*.php' -print0 | xargs -0 -n1 php -l
- name: Run webhook contract tests
run: php packages/coinpay-php/tests/WebhookTest.php
- name: Run client integration tests
run: php packages/coinpay-php/tests/ClientTest.php
build-zips:
name: Build installable zips
runs-on: ubuntu-latest
needs: lint-and-test
steps:
- uses: actions/checkout@v5
- uses: shivammathur/setup-php@v2
with:
php-version: '8.2'
extensions: curl, hash, json
coverage: none
tools: none
- name: Build zips
run: ./scripts/build-plugin-zips.sh
- uses: actions/upload-artifact@v4
with:
name: plugin-zips
path: dist/coinpay-*.zip
retention-days: 14