Skip to content

Commit cc81de0

Browse files
Merge pull request #60 from pressbooks/dev
2.1.0 release
2 parents 9fb35e6 + 05c1a2e commit cc81de0

24 files changed

Lines changed: 177 additions & 12150 deletions

.github/workflows/ci.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
branches: [ dev, master ]
6+
pull_request:
7+
branches: [ dev ]
8+
9+
jobs:
10+
11+
functional:
12+
name: Functional - WP ${{ matrix.wp }} on PHP ${{ matrix.php }} with MySQL ${{ matrix.mysql }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: ['7.3', '7.4']
17+
wp: ['latest']
18+
mysql: ['8.0']
19+
runs-on: ubuntu-latest
20+
21+
services:
22+
mysql:
23+
image: mysql:${{ matrix.mysql }}
24+
ports:
25+
- 3306
26+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=wp_cli_test --entrypoint sh mysql:${{ matrix.mysql }} -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
27+
28+
steps:
29+
- name: Check out source code
30+
uses: actions/checkout@v2
31+
32+
- name: Check existence of composer.json & behat.yml files
33+
id: check_files
34+
uses: andstor/file-existence-action@v1
35+
with:
36+
files: "composer.json, behat.yml"
37+
38+
- name: Set up PHP envirnoment
39+
if: steps.check_files.outputs.files_exists == 'true'
40+
uses: shivammathur/setup-php@v2
41+
with:
42+
php-version: '${{ matrix.php }}'
43+
extensions: mysql, zip
44+
coverage: none
45+
tools: composer
46+
47+
- name: Get Composer cache Directory
48+
if: steps.check_files.outputs.files_exists == 'true'
49+
id: composer-cache
50+
run: |
51+
echo "::set-output name=dir::$(composer config cache-files-dir)"
52+
- name: Use Composer cache
53+
if: steps.check_files.outputs.files_exists == 'true'
54+
uses: actions/cache@master
55+
with:
56+
path: ${{ steps['composer-cache'].outputs.dir }}
57+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
58+
restore-keys: |
59+
${{ runner.os }}-composer-
60+
- name: Install dependencies
61+
if: steps.check_files.outputs.files_exists == 'true'
62+
run: COMPOSER_ROOT_VERSION=dev-master composer install --prefer-dist --no-progress --no-suggest
63+
64+
- name: Start MySQL server
65+
if: steps.check_files.outputs.files_exists == 'true'
66+
run: sudo systemctl start mysql
67+
68+
- name: Configure DB environment
69+
if: steps.check_files.outputs.files_exists == 'true'
70+
run: |
71+
export MYSQL_HOST=127.0.0.1
72+
export MYSQL_TCP_PORT=${{ job.services.mysql.ports['3306'] }}
73+
echo "WP_CLI_TEST_DBROOTUSER=root" >> $GITHUB_ENV
74+
echo "WP_CLI_TEST_DBROOTPASS=root" >> $GITHUB_ENV
75+
echo "WP_CLI_TEST_DBUSER=wp_cli_test" >> $GITHUB_ENV
76+
echo "WP_CLI_TEST_DBPASS=password1" >> $GITHUB_ENV
77+
echo "WP_CLI_TEST_DBHOST=$MYSQL_HOST:$MYSQL_TCP_PORT" >> $GITHUB_ENV
78+
- name: Prepare test database
79+
if: steps.check_files.outputs.files_exists == 'true'
80+
run: composer prepare-tests
81+
82+
- name: Run Behat
83+
if: steps.check_files.outputs.files_exists == 'true'
84+
env:
85+
WP_VERSION: '${{ matrix.wp }}'
86+
run: composer behat

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.DS_Store
2+
.vuepress/dist
23
composer.phar
34
installer
45
wp-cli.local.yml

.travis.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.vuepress/dist/.gitkeep

Whitespace-only changes.

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Same options as: https://github.com/wp-cli/i18n-command#wp-i18n-make-pot
177177

178178
## Installing
179179

180-
Installing this package requires WP-CLI v2.1.0 or greater. Update to the latest stable release with `wp cli update`.
180+
Installing this package requires WP-CLI v2.5.0 or greater. Update to the latest stable release with `wp cli update`.
181181

182182
Once you've done so, you can install this package with:
183183

@@ -187,6 +187,5 @@ Once you've done so, you can install this package with:
187187
## Upgrade Notice
188188

189189

190-
### 2.0.1
191-
* PB-CLI requires Pressbooks >= 5.7.0
192-
190+
### 2.1.0
191+
* PB-CLI requires Pressbooks >= 5.21.0

behat.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
default:
2+
suites:
3+
default:
4+
contexts:
5+
- Pressbooks_CLI\Tests\Context\FeatureContext
6+
paths:
7+
- features

bin/install-package-tests.sh

Lines changed: 0 additions & 40 deletions
This file was deleted.

composer.json

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,53 @@
11
{
22
"name": "pressbooks/pb-cli",
3-
"description": "A suite of wp-cli commands for Pressbooks.",
43
"type": "wp-cli-package",
4+
"description": "A suite of wp-cli commands for Pressbooks.",
55
"homepage": "https://github.com/pressbooks/pb-cli/",
66
"license": "GPL-3.0-or-later",
77
"authors": [],
8-
"autoload": {
9-
"psr-4": {
10-
"Pressbooks_CLI\\": "inc/"
11-
},
12-
"files": ["command.php"]
8+
"require": {
9+
"php": ">=7.3",
10+
"jenssegers/blade": "1.1.0"
11+
},
12+
"require-dev": {
13+
"wp-cli/entity-command": "^2.1",
14+
"wp-cli/extension-command": "^2.1",
15+
"wp-cli/i18n-command": "^2.2",
16+
"wp-cli/scaffold-command": "^2.0",
17+
"wp-cli/wp-cli": "^2.5",
18+
"wp-cli/wp-cli-tests": "^3.0"
1319
},
1420
"config": {
1521
"platform": {
16-
"php": "7.1"
22+
"php": "7.3"
1723
}
1824
},
19-
"require": {
20-
"php": ">=7.1"
25+
"extra": {
26+
"commands": [
27+
"scaffold book-theme",
28+
"pb issue-template",
29+
"pb theme lock",
30+
"pb theme unlock",
31+
"pb clone",
32+
"pb make-pot"
33+
]
34+
},
35+
"autoload": {
36+
"psr-4": {
37+
"Pressbooks_CLI\\": "inc/"
2138
},
22-
"require-dev": {
23-
"behat/behat": "^2.5",
24-
"wp-cli/wp-cli": "^2",
25-
"wp-cli/i18n-command": "^2.1.2"
39+
"files": [
40+
"command.php"
41+
]
2642
},
27-
"extra": {
28-
"commands": ["scaffold book-theme", "pb issue-template", "pb theme lock", "pb theme unlock", "pb clone", "pb make-pot"]
43+
"minimum-stability": "dev",
44+
"prefer-stable": true,
45+
"scripts": {
46+
"behat": "run-behat-tests",
47+
"behat-rerun": "rerun-behat-tests",
48+
"prepare-tests": "install-package-tests",
49+
"test": [
50+
"@behat"
51+
]
2952
}
3053
}

0 commit comments

Comments
 (0)