Skip to content

Default Changelist

Default Changelist #4

Workflow file for this run

name: Deploy Plugin
on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
php: [ '7.4', '8.0' ] # PHP versions to check.
wp: [ 'latest', '5.9' ] # WordPress version to check.
services:
mysql:
image: mysql:5.7
options: --health-cmd "mysqladmin ping --host 127.0.0.1 --port 3306" --health-interval 20s --health-timeout 10s --health-retries 10
ports:
- 3306/tcp
env:
MYSQL_ROOT_PASSWORD: root
name: WordPress ${{ matrix.wp }} in PHP ${{ matrix.php }} UnitTest
steps:
- uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: composer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist
- name: Start MySQL
run: sudo systemctl start mysql
- name: Install WordPress
run: bash bin/install-wp-tests.sh wordpress root root 127.0.0.1:3306 ${{ matrix.wp }}
- name: Check PHP Unit
run: composer test
lint:
runs-on: ubuntu-latest
name: WordPress Syntax Check
steps:
- uses: actions/checkout@master
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Validate composer.json and composer.lock
run: composer validate
- name: Install dependencies
run: composer install --prefer-dist
- name: Check PHP syntax
run: composer lint
assets:
name: Check Assets
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: '14'
- name: Install NPM Packages
run: npm install
- name: Check JS & CSS syntax
run: npm run lint
pre_release:
name: Create Release
needs: [ test, assets ]
if: contains(github.ref, 'tags/')
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.export.outputs.upload_url }}
steps:
- uses: actions/checkout@master
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release Render Faster ${{ github.ref }}
body: |
Release Render FAster version ${{ github.ref }}.
draft: false
prerelease: false
- name: Export Upload URL
id: export
run: echo "::set-output name=upload_url::${{ steps.create_release.outputs.upload_url }}"
release:
name: Deploy GitHub Release
needs: pre_release
if: contains(github.ref, 'tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Confirm
run: echo ${{ needs.pre_release.outputs.upload_url }}
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
tools: composer
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install NPM
uses: actions/setup-node@v1
with:
node-version: '14'
- name: Build package.
run: bash bin/build.sh ${{ github.ref }}
- name: Cleanup package.
run: bash bin/clean.sh
- name: Create Zip
run: zip -r tscf.zip ./
- name: Upload Release Zip
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.pre_release.outputs.upload_url }}
asset_path: ./tscf.zip
asset_name: tscf.zip
asset_content_type: application/zip