From f0c3a4008805c2c5e8b19414c69ccdf58d10779c Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Mon, 11 Nov 2024 17:21:48 +0100 Subject: [PATCH] ci: add workflow to run wp plugin checks --- .distignore | 1 + .gitattributes | 1 + .github/workflows/wordpress-plugin-check.yml | 31 ++++++++++++++++++++ .gitignore | 1 + 4 files changed, 34 insertions(+) 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/.gitattributes b/.gitattributes index 7066f378..e0ce1079 100644 --- a/.gitattributes +++ b/.gitattributes @@ -18,6 +18,7 @@ /.stylelintrc.json export-ignore /composer.json export-ignore /composer-php5.json export-ignore +/dist export-ignore /package.json export-ignore /package-lock.json export-ignore /composer.lock export-ignore diff --git a/.github/workflows/wordpress-plugin-check.yml b/.github/workflows/wordpress-plugin-check.yml new file mode 100644 index 00000000..eda897d5 --- /dev/null +++ b/.github/workflows/wordpress-plugin-check.yml @@ -0,0 +1,31 @@ +name: Plugin check +on: + push: + branches: [ 'stable', 'release/*' ] + 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: Build + 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 f7dad9c0..8cdaf442 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .nyc_output composer.lock coverage +dist/ css/*.min.css js/*.min.js js/*.min.js.map