Skip to content

Commit bd38352

Browse files
authored
GitHub Actions (#88)
1 parent c90b1b0 commit bd38352

4 files changed

Lines changed: 81 additions & 33 deletions

File tree

.github/workflows/test.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- '**.md'
9+
workflow_dispatch:
10+
workflow_call:
11+
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
lint:
18+
strategy:
19+
matrix:
20+
php-version: ['7.4']
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php-version }}
29+
tools: composer
30+
31+
- name: Validate composer.json
32+
run: composer validate --strict
33+
34+
behat:
35+
needs: lint
36+
strategy:
37+
matrix:
38+
php-version: ['7.4']
39+
runs-on: ubuntu-latest
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Setup PHP
44+
uses: shivammathur/setup-php@v2
45+
with:
46+
php-version: ${{ matrix.php-version }}
47+
tools: composer
48+
49+
- run: composer install
50+
51+
- run: |
52+
sudo systemctl start mysql.service
53+
mysql -e "CREATE DATABASE ${WP_CLI_TEST_DBNAME};" -uroot -proot
54+
mysql -e "CREATE USER '${WP_CLI_TEST_DBUSER}'@'localhost' IDENTIFIED BY '${WP_CLI_TEST_DBPASS}';" -uroot -proot
55+
mysql -e "GRANT ALL PRIVILEGES ON ${WP_CLI_TEST_DBNAME}.* TO '${WP_CLI_TEST_DBUSER}'@'localhost';" -uroot -proot
56+
mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY ''; FLUSH PRIVILEGES;" -uroot -proot
57+
composer run behat
58+
env:
59+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
60+
MYSQL_DATABASE: wp_cli_test
61+
MYSQL_USER: wp_cli_test
62+
MYSQL_PASSWORD: password1
63+
MYSQL_HOST: 127.0.0.1
64+
WP_CLI_TEST_DBUSER: wp_cli_test
65+
WP_CLI_TEST_DBPASS: password1
66+
WP_CLI_TEST_DBNAME: wp_cli_test
67+
WP_CLI_TEST_DBHOST: 127.0.0.1:3306

.travis.yml

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

composer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"wp-cli/wp-cli-tests": "^3.0.15"
4949
},
5050
"scripts": {
51-
"behat": "run-behat-tests",
51+
"behat": "behat",
5252
"update-readme": "wp scaffold package-readme . --force"
5353
},
5454
"extra": {
@@ -77,6 +77,12 @@
7777
}
7878
},
7979
"config": {
80-
"sort-packages": true
80+
"sort-packages": true,
81+
"allow-plugins": {
82+
"composer/installers": true,
83+
"roots/wordpress-core-installer": true,
84+
"dealerdirect/phpcodesniffer-composer-installer": true,
85+
"koodimonni/composer-dropin-installer": true
86+
}
8187
}
8288
}

src/Installer/ComposerRequireSqliteIntegration.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ public function installSqliteIntegration()
2121
'no-interaction' => true,
2222
];
2323

24+
Composer::config(
25+
'allow-plugins.koodimonni/composer-dropin-installer',
26+
'true',
27+
array_merge($flags, ['no-plugins' => true])
28+
);
29+
2430
Composer::_require('koodimonni/composer-dropin-installer:^1.0', $flags);
2531

2632
Composer::config('extra.dropin-paths.web/app/', 'package:aaemnnosttv/wp-sqlite-db:src/db.php', $flags);

0 commit comments

Comments
 (0)