Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
ho-man-chan committed Dec 20, 2021
2 parents 7e05b7e + b6725b0 commit ffca46d
Show file tree
Hide file tree
Showing 65 changed files with 1,150 additions and 482 deletions.
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ updates:
directory: "/"
# Check for updates monthly
schedule:
interval: "monthly"
interval: "daily"
allow:
# Allow direct updates only (for packages named in package.json)
- dependency-type: "direct"
Expand All @@ -19,7 +19,7 @@ updates:
directory: "/packages/aetna"
# Check for updates monthly
schedule:
interval: "monthly"
interval: "daily"
allow:
# Allow direct updates only (for packages named in package.json)
- dependency-type: "direct"
Expand All @@ -32,7 +32,7 @@ updates:
directory: "/packages/buckram"
# Check for updates monthly
schedule:
interval: "monthly"
interval: "daily"
allow:
# Allow direct updates only (for packages named in package.json)
- dependency-type: "direct"
Expand All @@ -45,7 +45,7 @@ updates:
directory: "/"
# Check for updates monthly
schedule:
interval: "monthly"
interval: "daily"
allow:
# Allow direct updates only (for packages named in composer.json)
- dependency-type: "direct"
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/.pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ jobs:
matrix:
php: [ 7.3 ]
os: [ ubuntu-18.04 ]
wordpress: [5.8.1, latest]
wordpress: [ 5.8.2 ]
experimental: [false]
include:
- php: 7.4
os: ubuntu-20.04
wordpress: latest
experimental: true
- php: 7.4
os: ubuntu-20.04
wordpress: 'trunk'
experimental: true
name: Test - PHP ${{ matrix.php }} - WP ${{ matrix.wordpress }}

env:
Expand Down Expand Up @@ -76,35 +80,41 @@ jobs:
run: |
export PATH="$HOME/.composer/vendor/bin:$PATH"
composer install --no-interaction
composer global require "phpunit/phpunit:7.5.20"
composer require --dev yoast/phpunit-polyfills
- name: Run Lint
run: npm run lint
if: matrix.experimental == false

- name: Run Frontend Tests
run: |
npm run test
lerna run test
if: matrix.experimental == false

- 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 Coverage
- name: Run PHP Tests and PCOV
run: composer require pcov/clobber; vendor/bin/pcov clobber; vendor/bin/phpunit --configuration phpunit.xml --coverage-clover coverage.xml
if: matrix.experimental == false

- name: Run Frontend Tests
run: |
npm run test
lerna run test
- name: Upload Coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
if: matrix.experimental == false

- name: Run PHP Tests
run: composer test
if: matrix.experimental == true && matrix.wordpress != 'trunk'

- name: Upload Coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
if: matrix.experimental == false
- name: Run PHP Tests with PHPUnit 9
run: |
composer remove --dev phpunit/phpunit
composer update --dev yoast/phpunit-polyfills --with-dependencies --ignore-platform-reqs
vendor/bin/phpunit --configuration phpunit9.xml
if: matrix.experimental == true && matrix.wordpress == 'trunk'

- name: Prepare Build
if: startsWith(github.ref, 'refs/tags/')
Expand Down
20 changes: 9 additions & 11 deletions .github/workflows/update-pot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,16 @@ jobs:
tools: composer, wp-cli
- name: Install dependencies
run: |
wp package install wp-cli/i18n-command:2.2.6
wp package install pressbooks/pb-cli:dev-dev#800cec8
wp package install wp-cli/i18n-command:2.2.8
cd /home/runner/.wp-cli/packages/
composer config repositories.wp-cli '{"type": "composer","url": "https://wp-cli.org/package-index/","canonical": false}'
cd ./
wp package install pressbooks/pb-cli:2.1.0
composer require jenssegers/blade:1.1.0
- name: Update POT file
run: wp pb make-pot . languages/pressbooks-book.pot --require=vendor/autoload.php --domain=pressbooks-book --slug=pressbooks-book --package-name="McLuhan" --headers="{\"Report-Msgid-Bugs-To\":\"https://github.com/pressbooks/pressbooks-book/issues\"}"
# Remove the next four lines and uncomment the last five lines once the process has been confirmed to work as desired.
- uses: actions/upload-artifact@v2
- name: Commit updated POT file
uses: stefanzweifel/[email protected]
with:
name: pressbooks-book.pot
path: languages/pressbooks-book.pot
# - name: Commit updated POT file
# uses: stefanzweifel/[email protected]
# with:
# commit_message: 'chore(l10n): update languages/pressbooks-book.pot'
# file_pattern: '*.pot'
commit_message: 'chore(l10n): update languages/pressbooks-book.pot'
file_pattern: '*.pot'
29 changes: 29 additions & 0 deletions .github/workflows/update-translations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Update translations from Transifex

on: workflow_dispatch

jobs:
update-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Transifex Client
run: sudo pip install transifex-client
- name: Pull translations from Transifex
run: tx pull --all --force --minimum-perc=25
env:
TX_TOKEN: ${{ secrets.TX_TOKEN }}
- name: Install xgettext
run: sudo apt-get install -y gettext
- name: Generate MO files
run: for file in languages/*.po ; do msgfmt $file -o `echo $file | sed 's/\(.*\.\)po/\1mo/'` ; done
# Remove the next four lines and uncomment the last six lines once the process has been confirmed to work as desired.
- uses: actions/upload-artifact@v2
with:
name: pressbooks-book-languages
path: languages/
# - name: Commit updated translation files
# uses: stefanzweifel/[email protected]
# with:
# commit_message: 'chore(l10n): update translations'
# file_pattern: *.mo *.po
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This theme is named after Canadian media theorist Marshall McLuhan, who coined t

* PHP >= 7.3
* WordPress >= 5.8.2
* Pressbooks >= 5.30.0
* Pressbooks >= 5.31.0

## Installation

Expand All @@ -41,7 +41,7 @@ Then, from the GitHub Updater interface, navigate to the "Install Theme" tab. En

## Changelog

### 2.14.0
### 2.15.0

* See: https://github.com/pressbooks/pressbooks-book/releases/tag/2.14.0
* See: https://github.com/pressbooks/pressbooks-book/releases/tag/2.15.0
* Full release history available at: https://github.com/pressbooks/pressbooks-book/releases
2 changes: 1 addition & 1 deletion comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<?php if ( have_comments() ) : ?>
<h3 id="comments-title">
<?php
printf( // WPCS: XSS OK.
printf(
esc_html(
/* translators: %1$d: number of responses, %2$s: title of section */
_nx(
Expand Down
12 changes: 8 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
"soberwp/intervention": "1.2.0-p"
},
"require-dev": {
"phpunit/phpunit": "~7.5",
"pressbooks/coding-standards": "^1.0",
"wpreadme2markdown/wp2md": "^3.0"
"pressbooks/coding-standards": "^1.1",
"wpreadme2markdown/wp2md": "^3.0",
"phpunit/phpunit": "^7.5",
"yoast/phpunit-polyfills": "^1.0.1"
},
"archive": {
"exclude": [".github", ".tx", "bin"]
Expand All @@ -37,8 +38,11 @@
],
"scripts": {
"test": [
"vendor/bin/phpunit --configuration phpunit.xml --coverage-clover coverage.xml"
"vendor/bin/phpunit --configuration phpunit.xml"
],
"test-coverage": [
"vendor/bin/phpunit --configuration phpunit.xml --coverage-clover coverage.xml -coverage-html=./coverage-reports"
],
"standards": [
"vendor/bin/phpcs --standard=phpcs.ruleset.xml inc partials *.php"
],
Expand Down
Loading

0 comments on commit ffca46d

Please sign in to comment.