Setup code quality and tests

This commit is contained in:
David Stone
2025-02-01 15:18:13 -07:00
parent 9b3a0798f0
commit 6ff9a28403
8 changed files with 3231 additions and 0 deletions

49
.circleci/config.yml Normal file
View File

@ -0,0 +1,49 @@
workflows:
version: 2
main:
jobs:
- php74-build
version: 2
job-references:
mysql_image: &mysql_image
circleci/mysql:5.6
setup_environment: &setup_environment
name: "Setup Environment Variables"
command: |
echo "export PATH=$HOME/.composer/vendor/bin:$PATH" >> $BASH_ENV
source /home/circleci/.bashrc
install_dependencies: &install_dependencies
name: "Install Dependencies"
command: |
sudo apt-get update && sudo apt-get install subversion
sudo -E docker-php-ext-install mysqli
sudo sh -c "printf '\ndeb http://ftp.us.debian.org/debian sid main\n' >> /etc/apt/sources.list"
sudo apt-get update && sudo apt-get install mysql-client-5.7
php_job: &php_job
environment:
- WP_TESTS_DIR: "/tmp/wordpress-tests-lib"
- WP_CORE_DIR: "/tmp/wordpress/"
steps:
- checkout
- run: *setup_environment
- run: *install_dependencies
- run:
name: "Run Tests"
command: |
composer install
# vendor/bin/phpcs
rm -rf $WP_TESTS_DIR $WP_CORE_DIR
bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest
phpunit
jobs:
php74-build:
<<: *php_job
docker:
- image: circleci/php:7.4
- image: *mysql_image