-
Notifications
You must be signed in to change notification settings - Fork 34
75 lines (64 loc) 路 2.22 KB
/
Copy pathtesting.yml
File metadata and controls
75 lines (64 loc) 路 2.22 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
name: Testing
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- master
schedule:
- cron: '17 1 * * *' # Run every day on a seemly random time.
jobs:
test:
uses: wp-cli/.github/.github/workflows/reusable-testing.yml@main
package-command-guidance:
permissions:
contents: read
name: Guidance for `wp package` without dev dependencies
runs-on: ubuntu-latest
steps:
- name: Check out source code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up PHP environment
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: 'latest'
coverage: none
- name: Install without dev dependencies
run: composer install --no-dev --no-interaction --prefer-dist
- name: Check that `wp package` points at package-command
run: |
if vendor/bin/wp package > stdout.txt 2> stderr.txt; then
echo 'Expected `wp package` to fail without wp-cli/package-command.'
exit 1
fi
cat stderr.txt
grep -qF 'composer require wp-cli/package-command' stderr.txt
minimum-php-guard:
name: Minimum PHP guard - PHP ${{ matrix.php }}
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
php: ['5.6', '7.1']
steps:
- name: Check out source code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up PHP environment
uses: shivammathur/setup-php@f3e473d116dcccaddc5834248c87452386958240 # v2
with:
php-version: '${{ matrix.php }}'
coverage: none
- name: Check minimum PHP guard
run: |
if php php/boot-phar.php > stdout.txt 2> stderr.txt; then
echo 'Expected boot-phar.php to reject unsupported PHP version.'
exit 1
fi
test ! -s stdout.txt
printf 'Error: WP-CLI requires PHP 7.2.24 or newer. You are running version %s.\n' "$(php -r 'echo PHP_VERSION;')" > expected.txt
diff -u expected.txt stderr.txt