Refactore test.yml for GitHub Actions #51
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |