Skip to content

Commit

Permalink
Add real composer.json (#71)
Browse files Browse the repository at this point in the history
* add a real composer.json
that has the proper format and could be used in packagist

* update vendor deps

* remove bower file
originally used by plugin generator which we don't need anymore

* add composer-diff workflow

* don't ignore composer.lock

* update composer deps

* remove old test installer

* ignore wpunit-helper scripts

* use wpunit-helpers

* use pantheon coding standards

* add composer scripts

* bump deps

* add base phpcs.xml

* fix linting

* lint

* linting

* add lint and test workflow

* chmod

* add phpunit

* add phpunit deps

* make tests compatible with modern yoast polyfill

* fix phpunit xml file

* fix tests

* remove get_page_by_title

* fix test

* add ./

* run lint after install
  • Loading branch information
jazzsequence authored Oct 8, 2024
1 parent 2dc6645 commit d9e6b19
Show file tree
Hide file tree
Showing 4,204 changed files with 351,330 additions and 52,829 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
28 changes: 28 additions & 0 deletions .github/workflows/composer-diff.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Composer Diff
on:
pull_request:
paths:
- 'composer.lock'
permissions:
contents: write
pull-requests: write
jobs:
composer-diff:
name: Composer Diff
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate composer diff
id: composer_diff
uses: IonBazan/composer-diff-action@v1
- uses: marocchino/sticky-pull-request-comment@v2
if: ${{ steps.composer_diff.outputs.composer_diff_exit_code != 0 }}
with:
header: composer-diff
message: |
<strong>Composer Changes</strong>
${{ steps.composer_diff.outputs.composer_diff }}
37 changes: 37 additions & 0 deletions .github/workflows/lint-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Lint & Test
on: [push]
permissions:
contents: write
actions: read
pull-requests: write
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Lint
run: |
composer install
composer lint
test:
name: Test
runs-on: ubuntu-latest
services:
mariadb:
image: mariadb:10.6
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start MariaDB
run: sudo systemctl start mysql
- name: Setup WP-CLI
uses: godaddy-wordpress/setup-wp-cli@1
- name: Install Composer dependencies
run: |
composer install
chmod +x bin/*.sh
bash ./bin/phpunit-test.sh
- name: Test
run: composer test
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
# Icon must end with two \r
Icon

# Ignore WP Unit Helpers
bin/helpers.sh
bin/install-local-tests.sh
bin/install-wp-tests.sh
bin/phpunit-test.sh

# Thumbnails
._*
Expand All @@ -29,7 +34,6 @@ bower_components
.bower-tmp

### Don't version control lock files
*.lock
package-lock.json

### Don't version control the yeoman generator file.
Expand Down
127 changes: 0 additions & 127 deletions bin/install-wp-tests.sh

This file was deleted.

18 changes: 0 additions & 18 deletions bower.json

This file was deleted.

44 changes: 43 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,50 @@
{
"name": "jazzsequence/games-collector",
"description": "A WordPress plugin to catalog all your tabletop (or other) games in your WordPress site and display a list of games in your collection.",
"type": "wordpress-plugin",
"authors": [
{
"name": "Chris Reynolds",
"email": "chris@jazzsequence.com"
}
],
"minimum-stability": "dev",
"prefer-stable": true,
"license": "GPL-3.0",
"require": {
"humanmade/coding-standards": "^1.1.0",
"johnbillion/extended-cpts": "^5.0",
"harvesthq/chosen": "^1.8",
"cmb2/cmb2": "^2.6"
},
"require-dev": {
"pantheon-systems/pantheon-wp-coding-standards": "^2.0",
"pantheon-systems/wpunit-helpers": "^2.0",
"phpunit/phpunit": "^9",
"yoast/phpunit-polyfills": "^3.0"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true,
"pantheon-systems/wpunit-helpers": true
}
},
"scripts": {
"lint:php": [
"php -l $(find . -name '*.php' | grep -v vendor | grep -v node_modules)"
],
"lint:phpcs": [
"vendor/bin/phpcs -s ."
],
"lint:phpcbf": [
"vendor/bin/phpcbf ."
],
"lint": [
"@lint:php",
"@lint:phpcs"
],
"phpunit": "vendor/bin/phpunit --do-not-cache-result",
"test": "@phpunit",
"test:install": "bin/install-local-tests.sh --skip-db=true",
"test:install:withdb": "bin/install-local-tests.sh"
}
}
Loading

0 comments on commit d9e6b19

Please sign in to comment.