Skip to content

Commit

Permalink
Merge pull request #3 from pressbooks/revivify
Browse files Browse the repository at this point in the history
Update this repo
  • Loading branch information
SteelWagstaff authored Apr 28, 2022
2 parents 6e9fd18 + 1c58749 commit f863279
Show file tree
Hide file tree
Showing 18 changed files with 16,165 additions and 11,222 deletions.
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: 2
updates:
# Maintain dependencies for npm
- package-ecosystem: "npm"
# Look for `package.json` and `package-lock.json` files in the root directory
directory: "/"
# Check for updates daily
schedule:
interval: "daily"
allow:
# Allow direct updates only (for packages named in package.json)
- dependency-type: "direct"
# Allow up to 10 open pull requests for npm dependencies
open-pull-requests-limit: 10

# Maintain dependencies for Composer
- package-ecosystem: "composer"
# Look for `composer.json` and `composer.lock` files in the root directory
directory: "/"
# Check for updates daily
schedule:
interval: "daily"
allow:
# Allow direct updates only (for packages named in composer.json)
- dependency-type: "direct"
# Allow up to 10 open pull requests for composer dependencies
open-pull-requests-limit: 10
Empty file removed .github/move.yml
Empty file.
17 changes: 0 additions & 17 deletions .github/stale.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/support.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ supportLabel: support
# Comment to post on issues marked as support requests. Add a link
# to a support page, or set to `false` to disable
supportComment: >
We use GitHub exclusively for bug reports and feature requests.
However, this issue appears to be a support request. Please use our
[support forum](http://discourse.pressbooks.org) to get help with Pressbooks Shibboleth SSO.
We use GitHub exclusively for bug reports and feature requests. However, this issue appears to be a support request.
Please use our [support forum](https://pressbooks.community) to get help with this plugin.
# Close issues marked as support requests
close: true
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/build-and-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build & Lint
on:
push:
branches: [ dev, master ]
tags:
- '*.*.*'
pull_request:
branches: [ dev ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '14' ]
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@v1
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Cache Node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
- name: Install Node dependencies & build assets
run: |
node -v
npm install
npm run build
- name: Run ESLint and Stylelint
run: npm run lint
75 changes: 75 additions & 0 deletions .github/workflows/standards-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Run Standards & Tests
on:
push:
branches: [ dev ]
tags:
- '*.*.*'
pull_request:
branches: [ dev ]
jobs:
tests:
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php: [ 7.4 ]
os: [ ubuntu-20.04 ]
wordpress: [ 5.9.3, latest ]
experimental: [ false ]
include:
- php: 8.0
os: ubuntu-20.04
wordpress: latest
experimental: true
name: Test - PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }}

env:
WP_VERSION: ${{ matrix.wordpress }}
WP_MULTISITE: 1

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Start required services
run: sudo systemctl start mysql.service

- name: Cache Composer packages
uses: actions/cache@v2
with:
path: vendor
key: ${{ matrix.php }}-php-${{ hashFiles('**/composer.lock') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: phpcs, composer
coverage: pcov

- name: Install PHP dependencies
run: |
export PATH="$HOME/.composer/vendor/bin:$PATH"
composer install --no-interaction
git clone --depth=1 https://github.com/pressbooks/pressbooks.git ../pressbooks
cd ../pressbooks && composer install --no-dev
cd ../pressbooks-plugin-scaffold
- name: Run PHP CodeSniffer
run: composer standards

- name: Install WP tests
run: bash bin/install-wp-tests.sh wordpress_test root root localhost ${{ matrix.wordpress }}

- name: Run PHP Tests
run: vendor/bin/phpunit
if: matrix.experimental == true

- name: Run PHP Tests and PCOV
run: composer test-coverage
if: matrix.experimental == false

- name: Upload Coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
if: matrix.experimental == false
65 changes: 0 additions & 65 deletions .travis.yml

This file was deleted.

72 changes: 32 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,70 +1,67 @@
# Pressbooks Plugin Scaffold
**Contributors:** conner_bw, greatislander
**Donate link:** https://pressbooks.org/donate/
**Tags:** pressbooks, plugin, scaffolding
**Requires at least:** 4.9.7
**Tested up to:** 4.9.7
**Stable tag:** 0.3.1
**License:** GPLv3 or later
**License URI:** https://www.gnu.org/licenses/gpl-3.0.html
# Pressbooks Plugin Scaffold

Scaffolding for a Pressbooks plugin.
**Contributors:** conner_bw, greatislander, steelwagstaff \
**Tags:** pressbooks, plugin, scaffolding \
**Requires at least:** 5.9.3 \
**Tested up to:** 5.9.3 \
**Stable tag:** 0.4.0 \
**License:** GPLv3 or later \
**License URI:** https://www.gnu.org/licenses/gpl-3.0.html

Scaffolding for a Pressbooks plugin.

## Description
## Description

This is not a plugin, but a tool that helps you scaffold a plugin.

## Installation

## Installation


# Create Plugin
# Create Plugin

Run `composer create-project pressbooks/pressbooks-plugin-scaffold <your-plugin-slug>`.

Run `yarn` to install dependencies.

Uncomment lines 34-43 of `pressbooks-plugin-scaffold.php` to enable Composer autoloader (you'll need to require a class to test for first).

Replace `pressbooks/pressbooks-plugin-slug` with `<your-github-username>/<your-plugin-slug>` throughout the project.
Replace `pressbooks/pressbooks-plugin-scaffold` with `<your-github-username>/<your-plugin-slug>` throughout the project.

Replace `pressbooks-plugin-slug` with `<your-plugin-slug>` throughout the project (renaming files as needed).
Replace `pressbooks-plugin-scaffold` with `<your-plugin-slug>` throughout the project (renaming files as needed).

Replace `PressbooksPluginScaffold` with `<YourNamespace>` throughout the project.

Run `npm install` to install dependencies.

# Optional Steps
Update readme.txt to reflect your plugin's name and description and run `composer readme` to generate an updated readme.md file.

Configure Travis deploys (instructions to come).
# Optional Steps

Configure Transifex project and localization (instructions to come).
Configure GitHub Action deploys (instructions to come).

Configure Transifex project and localization (instructions to come).

# Helpful Commands
# Helpful Commands

`composer standards`: check PHP coding standards with PHP_CodeSniffer
`composer test`: run unit tests with PHPUnit
`composer readme`: generate a Markdown readme from readme.txt
`composer localize`: update localization files (requires Transifex to be configured)
`yarn run test`: check SCSS/ES6 with StyleLint and ESLint
`yarn run build:production`: build assets for distribution

`npm run test`: check SCSS/ES6 with StyleLint and ESLint
`npm run build`: build assets for distribution

## Frequently Asked Questions
## Changelog

N/A.
### 0.4.0

## Upgrade Notice

## Screenshots

N/A.


## Changelog
Pressbooks Plugin Scaffold 0.4.0 requires PHP 7.4, Pressbooks >= 5.34.0, and WordPress >= 5.9.3.
**Major Changes**
- Add support for Composer 2
- Add GitHub Actions for linting and testing
- Add Dependabot config
- Update Dependencies

### 0.2.0

### 0.2.0
**Major Changes**
- A new feature.

Expand All @@ -73,8 +70,3 @@ N/A.

**Patches**
- A bug fix.


## Upgrade Notice

Pressbooks Plugin Scaffold requires Pressbooks >= 5.2.0 and WordPress >= 4.9.5.
6 changes: 3 additions & 3 deletions codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ coverage:

status:
project: yes
patch: yes
changes: no
patch: true
changes: false

notify:
# slack:
Expand All @@ -28,4 +28,4 @@ parsers:
comment:
layout: "header, diff"
behavior: default
require_changes: no
require_changes: false
Loading

0 comments on commit f863279

Please sign in to comment.