From 17c5cbb1561da98d4b134919c688c23711834d76 Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Sun, 22 Sep 2024 13:40:08 +0200 Subject: [PATCH] ci: add workflow to run wp plugin checks --- .distignore | 1 + .gitattributes | 1 + .github/workflows/wordpress-plugin-check.yml | 30 ++++++++++++++++++++ .gitignore | 1 + 4 files changed, 33 insertions(+) create mode 100644 .github/workflows/wordpress-plugin-check.yml diff --git a/.distignore b/.distignore index 19556d45..b5722723 100644 --- a/.distignore +++ b/.distignore @@ -3,6 +3,7 @@ /.github /.wordpress-org /bin +/dist /node_modules /tests /vendor diff --git a/.gitattributes b/.gitattributes index 325d49c3..dd72f48d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,6 +1,7 @@ # Directories /.github export-ignore /.wordpress-org export-ignore +/dist export-ignore /node_modules export-ignore /vendor export-ignore diff --git a/.github/workflows/wordpress-plugin-check.yml b/.github/workflows/wordpress-plugin-check.yml new file mode 100644 index 00000000..d43ba308 --- /dev/null +++ b/.github/workflows/wordpress-plugin-check.yml @@ -0,0 +1,30 @@ +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: Install + run: composer install --no-interaction + + - name: Package plugin + run: | + mkdir -p ./dist + rsync -rc --exclude-from=.distignore ./ ./dist/cachify --delete --delete-excluded + - name: Check WP plugin + uses: wordpress/plugin-check-action@v1 + with: + build-dir: ./dist/cachify diff --git a/.gitignore b/.gitignore index 2f0c03fa..3e54f846 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ .idea/ .phpunit.result.cache css/*.min.css +dist js/*.min.js vendor/ node_modules/