From fa1a3ad369518339948d810684526f5fac243674 Mon Sep 17 00:00:00 2001 From: Stefan Kalscheuer Date: Sat, 12 Oct 2024 11:53:02 +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 f8f9485..c26db0f 100644 --- a/.distignore +++ b/.distignore @@ -2,6 +2,7 @@ /.git /.github /.wordpress-org +/dist /node_modules /tests /vendor diff --git a/.gitattributes b/.gitattributes index 36c7b35..0648e13 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,6 +2,7 @@ /.github export-ignore /.wordpress-org export-ignore /bin export-ignore +/dist export-ignore /node_modules export-ignore /tests export-ignore diff --git a/.github/workflows/wordpress-plugin-check.yml b/.github/workflows/wordpress-plugin-check.yml new file mode 100644 index 0000000..457e165 --- /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/antivirus --delete --delete-excluded + - name: Check WP plugin + uses: wordpress/plugin-check-action@v1 + with: + build-dir: ./dist/antivirus diff --git a/.gitignore b/.gitignore index c9fe77b..04735a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea/ css/*.min.css +dist/ js/*.min.js vendor/ node_modules/