Skip to content

Refactore test.yml for GitHub Actions #51

Refactore test.yml for GitHub Actions

Refactore test.yml for GitHub Actions #51

Workflow file for this run

name: build
on:
push:
branches:
- "*"
jobs:
test:
runs-on: 'ubuntu-latest'
strategy:
matrix:
wordpress-version: [ '5.7', '5.8', '5.9', '6.0', '6.1', '6.2', '6.3', '6.4', '6.5', '6.6', '6.7' ]
steps:
- uses: actions/checkout@v4
- name: docker-run
shell: bash
run: |
docker build -t fmpress-ubuntu .
docker run -d --name testcontainer --rm -p 8080:80 fmpress-ubuntu
docker exec -i testcontainer sh -c "php -v"
docker exec -i testcontainer sh -c "/vendor/bin/phpcs -i"
docker exec -i testcontainer sh -c "/vendor/bin/phpcs --standard=/fmpress-forms/phpcs.xml --extensions=php /fmpress-forms"
docker exec -i testcontainer sh -c "/etc/init.d/mysql start &"
docker exec -i testcontainer sh -c "cd /var/www/html/wp-content/plugins/fmpress-forms && ./bin/install-wp-tests.sh wp root PASSWORD localhost ${{ matrix.php-version }} && /vendor/bin/phpunit --bootstrap=tests/phpunit/bootstrap.php tests/phpunit/fmpress-forms-test.php"