From 6be08e349c4ce7d5efd77adbe5104f726ca0006a Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Sat, 21 Sep 2024 17:13:04 +0200 Subject: [PATCH] ci: add workflow to run wp plugin checks on stable branch --- .distignore | 1 + .github/workflows/tests.yml | 5 ++-- .github/workflows/wordpress-plugin-check.yml | 31 ++++++++++++++++++++ .gitignore | 1 + 4 files changed, 35 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/wordpress-plugin-check.yml diff --git a/.distignore b/.distignore index f1f3fee0..e6e6faa1 100644 --- a/.distignore +++ b/.distignore @@ -5,6 +5,7 @@ /.wordpress-org /bin /coverage +/dist /node_modules /tests /vendor diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9dae8ac9..6418b65b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,8 +68,7 @@ jobs: with: node-version: '18' - name: Install - run: | - composer install --no-interaction - npm ci + run: composer install --no-interaction + - name: Code style checks for PHP, JS and CSS run: composer lint-all diff --git a/.github/workflows/wordpress-plugin-check.yml b/.github/workflows/wordpress-plugin-check.yml new file mode 100644 index 00000000..78f524b2 --- /dev/null +++ b/.github/workflows/wordpress-plugin-check.yml @@ -0,0 +1,31 @@ +name: Plugin check +on: + push: + branches: [ stable ] + pull_request: + branches: [ stable ] +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.2' + tools: composer + + - name: Install + run: composer install --no-interaction + + - name: Package plugin + run: | + mkdir -p ./dist + rsync -rc --exclude-from=.distignore ./ ./dist/statify --delete --delete-excluded + + - name: Check WP plugin + uses: wordpress/plugin-check-action@v1 + with: + build-dir: ./dist/statify diff --git a/.gitignore b/.gitignore index 2e8418ae..b91bc4a3 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ composer.lock coverage css/*.min.css +dist js/*.min.js js/*.min.js.map lib