diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml new file mode 100644 index 0000000..d834de8 --- /dev/null +++ b/.github/workflows/lint-php.yml @@ -0,0 +1,35 @@ +name: PHP Lint + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + lint: + name: PHP ${{ matrix.php }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: ['7.4', '8.0', '8.1', '8.2', '8.3'] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + tools: parallel-lint + coverage: none + + - name: Lint PHP files + run: parallel-lint . diff --git a/.github/workflows/playground-preview.yml b/.github/workflows/playground-preview.yml new file mode 100644 index 0000000..91a3cd8 --- /dev/null +++ b/.github/workflows/playground-preview.yml @@ -0,0 +1,21 @@ +name: Playground Preview + +on: + pull_request: + types: [opened, synchronize, reopened] + +permissions: + contents: read + pull-requests: write + +jobs: + preview: + name: Playground Preview + runs-on: ubuntu-latest + steps: + - name: Add Playground preview + uses: WordPress/action-wp-playground-pr-preview@v2 + with: + plugin-path: . + mode: comment + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/wpcs.yml b/.github/workflows/wpcs.yml new file mode 100644 index 0000000..b3ade22 --- /dev/null +++ b/.github/workflows/wpcs.yml @@ -0,0 +1,29 @@ +name: WordPress Coding Standards + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + phpcs: + name: WPCS + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: WPCS check + uses: 10up/wpcs-action@stable + with: + enable_warnings: true + standard: WordPress + only_changed_lines: true diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..75bed3a --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "name": "progressplanner/local-gravatars", + "description": "Locally host gravatars - for the privacy conscious.", + "type": "wordpress-plugin", + "homepage": "https://github.com/ProgressPlanner/local-gravatars", + "license": "MIT", + "require": { + "php": ">=7.4" + }, + "config": { + "optimize-autoloader": true, + "sort-packages": true + } +}