Update version tags to 10.6.12 #1485
This file contains hidden or 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: | |
beta: | |
if: > | |
startsWith(github.ref, 'refs/tags') | |
|| contains(github.event.head_commit.message, '[ci]') | |
|| contains(github.event.head_commit.message, '[cov]') | |
runs-on: ubuntu-latest | |
outputs: | |
ver: ${{ steps.get.outputs.ver }} | |
steps: | |
- name: Get latest WP beta version | |
id: get | |
run: >- | |
php --run "echo 'ver=' . | |
json_decode( file_get_contents( 'https://api.wordpress.org/core/version-check/1.7/?version=6.7&channel=beta' ) )->offers[0]->version;" | |
>> "$GITHUB_OUTPUT" | |
- name: Echo latest WP version (including beta releases) | |
run: echo ${{ steps.get.outputs.ver }} | |
test: | |
needs: beta | |
name: PHP Unit tests | |
runs-on: ubuntu-22.04 | |
env: | |
NGT_PHPUNIT_LOAD_PLUGINS: advanced-responsive-video-embedder,arve-pro,arve-random-video,arve-amp,arve-sticky-videos,arve-privacy | |
strategy: | |
fail-fast: false | |
matrix: | |
php: [ '7.4', '8.0', '8.1', '8.2', '8.3', '8.4' ] # https://www.php.net/supported-versions | |
wordpress: [ '6.5', "${{ needs.beta.outputs.ver }}" ] # 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 ARVE | |
uses: actions/checkout@v4 | |
with: | |
repository: nextgenthemes/advanced-responsive-video-embedder | |
path: plugins/advanced-responsive-video-embedder | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: rm composer.json from ARVE | |
run: rm composer.json | |
working-directory: plugins/advanced-responsive-video-embedder | |
- name: Checkout ARVE Pro | |
uses: actions/checkout@v4 | |
with: | |
repository: nextgenthemes/arve-pro | |
ref: master | |
path: plugins/arve-pro | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: Checkout ARVE Random Video | |
uses: actions/checkout@v4 | |
with: | |
repository: nextgenthemes/arve-random-video | |
ref: master | |
path: plugins/arve-random-video | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: Checkout ARVE Privacy | |
uses: actions/checkout@v4 | |
with: | |
repository: nextgenthemes/arve-privacy | |
ref: master | |
path: plugins/arve-privacy | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: Checkout ARVE AMP | |
uses: actions/checkout@v4 | |
with: | |
repository: nextgenthemes/arve-amp | |
ref: master | |
path: plugins/arve-amp | |
token: ${{ secrets.REPO_TOKEN }} | |
- name: Checkout ARVE Sticky Videos | |
uses: actions/checkout@v4 | |
with: | |
repository: nextgenthemes/arve-sticky-videos | |
ref: master | |
path: 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: ${{ contains(github.event.head_commit.message, '[cov]') && 'xdebug' || 'none' }} | |
- name: Start mysql service | |
run: sudo /etc/init.d/mysql start | |
- name: Install WP Tests | |
run: bash ./install-wp-tests.sh dbname root dbpass "127.0.0.1:$DB_PORT" ${{ matrix.wordpress }} true | |
working-directory: plugins/advanced-responsive-video-embedder/bin | |
env: | |
DB_PORT: ${{ job.services.mysql.ports['3306'] }} | |
- name: Run PHPUnit without code coverage | |
if: (!contains(github.event.head_commit.message, '[cov]')) | |
run: > | |
phpunit --testsuite "$NGT_PHPUNIT_LOAD_PLUGINS" && | |
NGT_PHPUNIT_LOAD_PLUGINS="advanced-responsive-video-embedder" phpunit --testsuite "$NGT_PHPUNIT_LOAD_PLUGINS" --group no-addons | |
working-directory: plugins/advanced-responsive-video-embedder | |
- name: Run PHPUnit with code coverage | |
if: contains(github.event.head_commit.message, '[cov]') && matrix.php == '8.3' && matrix.wordpress == needs.beta.outputs.ver | |
run: phpunit --testsuite "$NGT_PHPUNIT_LOAD_PLUGINS" --coverage-html coverage | |
working-directory: plugins/advanced-responsive-video-embedder | |
- name: Archive code coverage results | |
if: contains(github.event.head_commit.message, '[cov]') && matrix.php == '8.3' && matrix.wordpress == needs.beta.outputs.ver | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage-report | |
path: plugins/advanced-responsive-video-embedder/coverage | |
deploy-wporg: | |
needs: test | |
if: > | |
startsWith(github.ref, 'refs/tags') && | |
(!contains(github.ref, 'alpha') && !contains(github.ref, 'beta') && !contains(github.ref, 'dev')) | |
name: SVN commit to wp.org | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: advanced-responsive-video-embedder | |
- name: Deploy to WP.org | |
uses: nextgenthemes/action-wordpress-plugin-deploy@master | |
with: | |
workdir: advanced-responsive-video-embedder | |
version: ${{github.ref_name}} | |
svn_user: ${{ secrets.SVN_USERNAME }} | |
svn_pass: ${{ secrets.SVN_PASSWORD }} | |
verbose: true | |
dry-run: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'dev') }} | |
deploy-github: | |
needs: test | |
if: startsWith(github.ref, 'refs/tags') | |
name: Upload Release Asset | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@master | |
- name: git archive .zip | |
run: git archive -o /tmp/advanced-responsive-video-embedder-${{ github.ref_name }}.zip --prefix=advanced-responsive-video-embedder/ ${{ github.ref_name }} | |
- name: Copy to arve.zip for permalink to latest version | |
run: cp /tmp/advanced-responsive-video-embedder-${{ github.ref_name }}.zip /tmp/arve.zip | |
- name: Create Release | |
uses: softprops/action-gh-release@9d7c94cfd0a1f3ed45544c887983e9fa900f0564 # 2.0.4 https://github.com/softprops/action-gh-release/releases | |
with: | |
token: ${{ secrets.REPO_TOKEN }} | |
tag_name: ${{ github.ref_name }} | |
make_latest: true | |
files: | | |
/tmp/advanced-responsive-video-embedder-${{ github.ref_name }}.zip | |
/tmp/arve.zip |