Skip to content

Commit

Permalink
ci(lint) Add yaml linter
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre PÉRONNET <[email protected]>
  • Loading branch information
holyhope committed Mar 27, 2024
1 parent 524d4e5 commit da4e27e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 10 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
yaml-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ibiqlik/action-yamllint@v3
with:
config_data: |
extends: default
rules:
document-start:
present: false
truthy:
check-keys: false
21 changes: 11 additions & 10 deletions workflow-templates/wordpress-plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,27 @@ jobs:

steps:
- name: Start MySQL
run: |-
sudo /etc/init.d/mysql start
mysql -e 'CREATE DATABASE IF NOT EXISTS wordpress;' -uroot -proot
run: sudo /etc/init.d/mysql start

- name: Create the Database
run: mysql -e 'CREATE DATABASE IF NOT EXISTS wordpress;' -uroot -proot

- name: Setup WP-CLI
uses: godaddy-wordpress/setup-wp-cli@1

- name: Download WordPress
run: wp core download --path=wordpress --force --quiet
run: wp core download --path=wordpress --force

- name: Configure WordPress
run: >-
run: >
wp config create
--path=wordpress
--dbname=wordpress
--dbuser=root
--dbpass=root
- name: Install WordPress
run: >-
run: >
wp core install
--path=./wordpress
--url=localhost
Expand Down Expand Up @@ -93,26 +94,26 @@ jobs:
- name: Install dependencies
if: steps.metadata.outputs.is_composer == 'true'
working-directory: ${{ steps.metadata.outputs.plugin_dir }}
run: >-
run: >
test ! -f composer.json
|| composer install --prefer-dist --no-progress
- name: Scaffold the test suite
working-directory: ${{ steps.metadata.outputs.plugin_dir }}
run: >-
run: >
wp scaffold plugin-tests
--dir=$(pwd)
--force
${{ steps.metadata.outputs.plugin_name }}
- name: Install the tests
working-directory: ${{ steps.metadata.outputs.plugin_dir }}
run: >-
run: >
./bin/install-wp-tests.sh wordpress root root localhost latest true
- name: Run test suite
working-directory: ${{ steps.metadata.outputs.plugin_dir }}
run: >-
run: >
phpunit
--no-interaction
--log-junit
Expand Down

0 comments on commit da4e27e

Please sign in to comment.