Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub Actions #88

Merged
merged 16 commits into from
Dec 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Test

on:
pull_request:
branches:
- master
paths-ignore:
- '**.md'
workflow_dispatch:
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
strategy:
matrix:
php-version: ['7.4']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer

- name: Validate composer.json
run: composer validate --strict

behat:
needs: lint
strategy:
matrix:
php-version: ['7.4']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: composer

- run: composer install

- run: |
sudo systemctl start mysql.service
mysql -e "CREATE DATABASE ${WP_CLI_TEST_DBNAME};" -uroot -proot
mysql -e "CREATE USER '${WP_CLI_TEST_DBUSER}'@'localhost' IDENTIFIED BY '${WP_CLI_TEST_DBPASS}';" -uroot -proot
mysql -e "GRANT ALL PRIVILEGES ON ${WP_CLI_TEST_DBNAME}.* TO '${WP_CLI_TEST_DBUSER}'@'localhost';" -uroot -proot
mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY ''; FLUSH PRIVILEGES;" -uroot -proot
composer run behat
env:
MYSQL_ALLOW_EMPTY_PASSWORD: yes
MYSQL_DATABASE: wp_cli_test
MYSQL_USER: wp_cli_test
MYSQL_PASSWORD: password1
MYSQL_HOST: 127.0.0.1
WP_CLI_TEST_DBUSER: wp_cli_test
WP_CLI_TEST_DBPASS: password1
WP_CLI_TEST_DBNAME: wp_cli_test
WP_CLI_TEST_DBHOST: 127.0.0.1:3306
31 changes: 0 additions & 31 deletions .travis.yml

This file was deleted.

10 changes: 8 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"wp-cli/wp-cli-tests": "^3.0.15"
},
"scripts": {
"behat": "run-behat-tests",
"behat": "behat",
"update-readme": "wp scaffold package-readme . --force"
},
"extra": {
Expand Down Expand Up @@ -77,6 +77,12 @@
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"composer/installers": true,
"roots/wordpress-core-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"koodimonni/composer-dropin-installer": true
}
}
}
6 changes: 6 additions & 0 deletions src/Installer/ComposerRequireSqliteIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ public function installSqliteIntegration()
'no-interaction' => true,
];

Composer::config(
'allow-plugins.koodimonni/composer-dropin-installer',
'true',
array_merge($flags, ['no-plugins' => true])
);

Composer::_require('koodimonni/composer-dropin-installer:^1.0', $flags);

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