mirror of
https://gh.wpcy.net/https://github.com/WordPress/create-block-theme.git
synced 2026-04-24 11:58:30 +08:00
88 lines
2.4 KiB
YAML
88 lines
2.4 KiB
YAML
name: Run checks
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- trunk
|
|
jobs:
|
|
lint:
|
|
name: Lint
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: npm
|
|
|
|
- name: Install dependencies
|
|
uses: php-actions/composer@v6
|
|
with:
|
|
args: --ignore-platform-reqs
|
|
|
|
- name: Install Dependencies
|
|
run: npm i
|
|
|
|
- name: Run PHP Lint
|
|
run: npm run lint:php
|
|
|
|
- name: Run JS Lint
|
|
if: success() || failure()
|
|
run: npm run lint:js
|
|
|
|
- name: Run CSS Lint
|
|
if: success() || failure()
|
|
run: npm run lint:css
|
|
|
|
- name: Run Markdown Lint
|
|
if: success() || failure()
|
|
run: npm run lint:md-docs
|
|
|
|
- name: Run package.json Lint
|
|
if: success() || failure()
|
|
run: npm run lint:pkg-json
|
|
|
|
tests:
|
|
name: Test Suite
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v3
|
|
with:
|
|
node-version-file: '.nvmrc'
|
|
cache: npm
|
|
|
|
- name: Install Composer
|
|
uses: php-actions/composer@v6
|
|
with:
|
|
args: --ignore-platform-reqs
|
|
|
|
- name: Install Node Dependencies
|
|
run: npm i
|
|
|
|
- name: Compile JavaScript App
|
|
run: npm run build
|
|
|
|
- name: Setup MySQL
|
|
if: success() || failure()
|
|
uses: shogo82148/actions-setup-mysql@v1
|
|
with:
|
|
mysql-version: '8.0'
|
|
|
|
- name: Run JavaScript unit tests
|
|
run: npm run test:unit
|
|
|
|
- name: Install Subversion
|
|
run: sudo apt-get update -y && sudo apt-get install -y subversion
|
|
|
|
- name: Run PHP tests
|
|
run: |
|
|
mysql -uroot -h127.0.0.1 -e 'SELECT version()' \
|
|
&& ./bin/install-wp-tests.sh --wp-version=trunk --recreate-db wordpress_test root '' > /dev/null \
|
|
&& composer run-script test
|