require php 7.4 #544
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: test-deploy | |
on: [push, pull_request] | |
jobs: | |
test: | |
if: >- | |
startsWith(github.ref, 'refs/tags') | |
|| contains(github.event.head_commit.message, '[ci]') | |
name: PHP Unit tests | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ '7.4', '8.0', '8.1', '8.2' ] # https://www.php.net/supported-versions | |
wordpress: [ 'latest' ] # https://wordpress.org/download/releases/ | |
services: | |
mysql: | |
image: mysql:5.7 | |
env: | |
MYSQL_ALLOW_EMPTY_PASSWORD: false | |
MYSQL_ROOT_PASSWORD: dbpass | |
MYSQL_DATABASE: dbname | |
ports: | |
- 3306/tcp | |
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3 | |
steps: | |
- name: Checkout Websites | |
uses: actions/checkout@v3 | |
with: | |
repository: nextgenthemes/websites | |
ref: master | |
path: . | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: rm -rf symbiosistheme.com | |
run: rm -rf symbiosistheme.com | |
- name: rm composer.json | |
run: rm composer.json | |
- name: Checkout ARVE | |
uses: actions/checkout@v3 | |
with: | |
repository: nextgenthemes/advanced-responsive-video-embedder | |
path: symbiosistheme.com/web/app/plugins/advanced-responsive-video-embedder | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: Checkout ARVE Pro | |
uses: actions/checkout@v3 | |
with: | |
repository: nextgenthemes/arve-pro | |
ref: master | |
path: symbiosistheme.com/web/app/plugins/arve-pro | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: Checkout ARVE Random Video | |
uses: actions/checkout@v3 | |
with: | |
repository: nextgenthemes/arve-random-video | |
ref: master | |
path: symbiosistheme.com/web/app/plugins/arve-random-video | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: Checkout ARVE AMP | |
uses: actions/checkout@v3 | |
with: | |
repository: nextgenthemes/arve-amp | |
ref: master | |
path: symbiosistheme.com/web/app/plugins/arve-amp | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: Checkout ARVE Sticky Videos | |
uses: actions/checkout@v3 | |
with: | |
repository: nextgenthemes/arve-sticky-videos | |
ref: master | |
path: symbiosistheme.com/web/app/plugins/arve-sticky-videos | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: Setup PHP, with composer and extensions | |
uses: shivammathur/setup-php@7fdd3ece872ec7ec4c098ae5ab7637d5e0a96067 # 2.26.0 # https://github.com/shivammathur/setup-php/releases/ | |
with: | |
php-version: ${{ matrix.php }} | |
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On | |
extensions: mbstring, dom, zip, mysql, gd | |
tools: phpunit-polyfills:1 | |
coverage: none #optional | |
- name: Start mysql service | |
run: sudo /etc/init.d/mysql start | |
- name: Install WP Tests | |
run: bash ./bin/install-wp-tests.sh dbname root dbpass "127.0.0.1:$DB_PORT" ${{ matrix.wordpress }} true | |
env: | |
DB_PORT: ${{ job.services.mysql.ports['3306'] }} | |
- name: Run PHPUnit without code coverage | |
run: phpunit --testsuite advanced-responsive-video-embedder,arve-pro,arve-random-video,arve-amp,arve-sticky-videos | |
deploy: | |
if: >- | |
startsWith(github.ref, 'refs/tags') | |
&& ! startsWith(github.event.repository.name, 'arve-') | |
&& ! contains(github.ref, 'alpha') | |
needs: test | |
name: SVN commit to wp.org | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
path: advanced-responsive-video-embedder | |
- run: pwd | |
- name: Get the version | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT | |
- name: Set composer shared code repo | |
working-directory: advanced-responsive-video-embedder | |
run: composer config repositories.0 git https://github.com/nextgenthemes/wp-shared | |
- name: composer update --optimize-autoloader | |
working-directory: advanced-responsive-video-embedder | |
run: composer update --optimize-autoloader | |
- name: Deploy | |
uses: nextgenthemes/action-wordpress-plugin-deploy@master | |
with: | |
workdir: advanced-responsive-video-embedder | |
build_dirs: vendor | |
version: ${{ steps.get_version.outputs.VERSION }} | |
svn_user: ${{ secrets.SVN_USERNAME }} | |
svn_pass: ${{ secrets.SVN_PASSWORD }} | |
verbose: true |