Repository navigation
137 lines (128 loc) · 4.75 KB
/
Copy pathci.yml
File metadata and controls
137 lines (128 loc) · 4.75 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
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
name: CI
on:
push:
pull_request:
permissions:
contents: read
concurrency:
group: wordpress-ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
security:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
with:
fetch-depth: 0
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
- name: Fail-closed secret and sensitive-file gate
run: node scripts/secret-scan.mjs
- name: Reject whitespace and merge-marker damage
run: git diff --check
quality:
needs: security
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
with:
php-version: "8.2"
extensions: zip
coverage: none
- uses: ramsey/composer-install@a8d0d959dab41457692a5e2041bd9b757a119e3f # 3.2.1
- run: composer validate --strict
- run: composer audit --locked --no-interaction
- run: composer lint
- run: composer test
- run: php bin/build.php
- run: unzip -t dist/zipquantum-smart-links.zip
- name: Verify tracked-only package manifest
run: |
test "$(sha256sum dist/zipquantum-smart-links.zip | awk '{print $1}')" = "$(awk 'NR==1 {print $1}' dist/zipquantum-smart-links.zip.sha256)"
(cd dist && sha256sum -c zipquantum-smart-links.SHA256SUMS)
php -r '$m=json_decode(file_get_contents("dist/zipquantum-smart-links.manifest.json"),true,32,JSON_THROW_ON_ERROR); if (($m["dirty_override"]??true) || ($m["file_count"]??0)<1) exit(1);'
php-syntax:
needs: security
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
php: ["7.4", "8.0", "8.2", "8.3"]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: shivammathur/setup-php@bf6b4fbd49ca58e4608c9c89fba0b8d90bd2a39f # 2.35.5
with:
php-version: ${{ matrix.php }}
coverage: none
- name: Lint production PHP
run: find . -path './vendor' -prune -o -path './tests' -prune -o -name '*.php' -print0 | xargs -0 -n1 php -l
wordpress-matrix:
needs: security
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
wordpress: ["6.9.7", "7.0.4", "7.1"]
php: ["7.4", "8.0", "8.2", "8.3"]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
- name: Activate on WordPress ${{ matrix.wordpress }} and PHP ${{ matrix.php }}
run: >-
npx --yes @wp-playground/cli@3.1.53 run-blueprint
--wp=${{ matrix.wordpress }}
--php=${{ matrix.php }}
--blueprint=tests/blueprints/activation.json
--mount-dir "$GITHUB_WORKSPACE" /wordpress/wp-content/plugins/zipquantum-smart-links
--verbosity=quiet
woocommerce-matrix:
needs: security
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
blueprint: ["woocommerce-10.9.4.json", "woocommerce-11.0.1.json", "woocommerce-11.1.2.json"]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
- name: Load the conditional WooCommerce integration
run: >-
npx --yes @wp-playground/cli@3.1.53 run-blueprint
--wp=7.1
--php=8.3
--blueprint=tests/blueprints/${{ matrix.blueprint }}
--mount-dir "$GITHUB_WORKSPACE" /wordpress/wp-content/plugins/zipquantum-smart-links
--verbosity=quiet
forward-compatibility:
needs: security
runs-on: ubuntu-latest
timeout-minutes: 20
continue-on-error: true
strategy:
fail-fast: false
matrix:
php: ["8.4", "8.5"]
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "22"
- name: Exercise WordPress 7.1 on PHP ${{ matrix.php }}
run: >-
npx --yes @wp-playground/cli@3.1.53 run-blueprint
--wp=7.1
--php=${{ matrix.php }}
--blueprint=tests/blueprints/activation.json
--mount-dir "$GITHUB_WORKSPACE" /wordpress/wp-content/plugins/zipquantum-smart-links
--verbosity=quiet