Repository navigation
155 lines (152 loc) · 6.01 KB
/
Copy pathtests.yml
File metadata and controls
155 lines (152 loc) · 6.01 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
name: Tests
'on':
push:
branches:
- craft-5
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
php-check:
name: PHP 8.2.0 syntax and imports
runs-on: ubuntu-22.04
container: php:8.2.0-cli@sha256:fa840989efc52df732278f59377e780f65d6aa8c384bb9724babf190b49f4c35
env:
COMPOSER_ALLOW_SUPERUSER: 1
timeout-minutes: 20
steps:
- name: Install Git for checkout
run: |
sed -i 's|deb.debian.org/debian-security|archive.debian.org/debian-security|g; s|deb.debian.org/debian|archive.debian.org/debian|g; /bullseye-updates/d' /etc/apt/sources.list
apt-get -o Acquire::Check-Valid-Until=false update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git ca-certificates
- uses: actions/checkout@v5
- name: Verify complete checkout
run: |
# Checkout trusts the workspace only in its temporary Git configuration.
git config --global --add safe.directory "$GITHUB_WORKSPACE"
test "$(git rev-parse --is-inside-work-tree)" = true
test -f .github/scripts/setup-minimum-php.sh
test -f tests/php-check/tests/run.php
- name: Install minimum PHP dependencies
run: bash .github/scripts/setup-minimum-php.sh
- name: Verify exact minimum interpreter
run: 'php -r ''echo PHP_VERSION, PHP_EOL; exit(PHP_VERSION === "8.2.0" ? 0 : 1);''
'
- name: Verify integration dependency lock
run: php .github/scripts/check-runtime-lock.php
- name: Install class checker
run: composer install --working-dir=tests/php-check --no-interaction --prefer-dist --no-progress --no-plugins --no-scripts
- name: Class checker regression tests
run: php tests/php-check/tests/run.php
- name: Check validation tooling
run: php tests/php-check/bin/check.php --project tests/php-check --vendor tests/php-check/vendor tests/php-check/src tests/php-check/bin tests/php-check/prepare.php tests/php-check/tests
- name: Prepare minimum PHP dependencies
run: php tests/php-check/prepare.php
- name: Install retained dependencies on PHP 8.2.0
run: composer install --working-dir=.cache/verbb-tests/app --no-interaction --prefer-dist --no-progress --no-plugins --no-scripts
- name: Verify dependency platform requirements
run: composer check-platform-reqs --working-dir=.cache/verbb-tests/app --no-plugins
- name: Check all production PHP
run: php tests/php-check/bin/check.php --project . --vendor .cache/verbb-tests/app/vendor --optional tests/php-check/optional.json src .github/scripts tests/runtime/run.php tests/runtime/pest.php tests/bootstrap-craft.php tests/php-check/prepare.php
- name: Dependency diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: php-8.2.0-dependencies
include-hidden-files: true
path: |
.cache/verbb-tests/app/composer.json
.cache/verbb-tests/app/composer.lock
pest:
name: PHP ${{ matrix.php }} (${{ matrix.order }})
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
php:
- '8.2'
- '8.3'
- '8.4'
order:
- default
- random
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Validate Composer manifest
run: composer validate --no-plugins --no-check-publish
- name: Build production assets
run: npm ci && npm run test:frontend && npm run build
- uses: "./.github/actions/setup-test-runtime"
with:
php-version: "${{ matrix.php }}"
docroot: tests/runtime/web
- name: Clean-install integration and performance tests
run: bash .github/scripts/run-ci.sh "${{ matrix.php }}" "${{ matrix.order }}"
- name: Test diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: test-diagnostics-php-${{ matrix.php }}-${{ matrix.order }}
include-hidden-files: true
path: |-
.cache/verbb-tests/latest.log
.cache/verbb-tests/junit.xml
.cache/verbb-tests/result.json
.cache/verbb-tests/app/storage/logs/
.cache/verbb-tests/events.log
.cache/verbb-tests/interpreter.json
.cache/verbb-tests/tested-inputs.json
pest-minimum:
name: PHP 8.2.0 (${{ matrix.order }})
runs-on: ubuntu-latest
timeout-minutes: 45
strategy:
fail-fast: false
matrix:
order:
- default
- random
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Build production assets
run: npm ci && npm run build
- uses: "./.github/actions/setup-test-runtime"
with:
php-version: 8.2.0
docroot: tests/runtime/web
- name: Verify exact minimum interpreter and integration lock
run: |
ddev exec --service php-minimum --raw -- php -r 'echo PHP_VERSION, PHP_EOL; exit(PHP_VERSION === "8.2.0" ? 0 : 1);'
ddev exec --service php-minimum --raw -- php .github/scripts/check-runtime-lock.php
- name: Clean-install integration and performance tests
run: bash .github/scripts/run-ci.sh "8.2.0" "${{ matrix.order }}"
- name: Verify installed dependency platform requirements
run: ddev exec --service php-minimum --raw -- composer check-platform-reqs --working-dir=.cache/verbb-tests/app --no-plugins
- name: Test diagnostics
if: always()
uses: actions/upload-artifact@v4
with:
name: php-8.2.0-${{ matrix.order }}
include-hidden-files: true
path: |-
.cache/verbb-tests/latest.log
.cache/verbb-tests/junit.xml
.cache/verbb-tests/result.json
.cache/verbb-tests/app/composer.json
.cache/verbb-tests/app/composer.lock
.cache/verbb-tests/app/storage/logs/
.cache/verbb-tests/events.log
.cache/verbb-tests/interpreter.json
.cache/verbb-tests/tested-inputs.json