Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
76b9413
GH Actions: minor simplification
jrfnl Dec 19, 2022
f235082
GH Actions: improve performance of the CS step
jrfnl Dec 19, 2022
c5b1d47
GH Actions: enable linting and testing against PHP 8.3
jrfnl Dec 19, 2022
5893d49
Merge pull request #87 from Yoast/feature/ghactions-tweaks
jrfnl Dec 19, 2022
2c5638c
Composer: update YoastCS and dependencies
jrfnl Jan 9, 2023
d525fe0
Merge pull request #88 from Yoast/JRF/update-yoastcs-dependencies
jrfnl Jan 9, 2023
b63c01c
Tests: make dataproviders `static`
jrfnl Mar 10, 2023
686f13b
Merge pull request #89 from Yoast/feature/phpunit-10-make-testsuite-c…
jrfnl Mar 10, 2023
1d3fa52
AssertClosedResourceTestCase: update exception message expectation
jrfnl Mar 10, 2023
86657f3
AssertClosedResourceNotResourceTest: update exception message expecta…
jrfnl Mar 10, 2023
4485b06
Merge pull request #90 from Yoast/feature/phpunit-10-tweak-test-expec…
jrfnl Mar 10, 2023
23397bb
Tests: minor update for release of PHPUnit 10.0.0
jrfnl Jun 6, 2021
b5d4d6c
Merge pull request #91 from Yoast/feature/tests-update-requires-tags
jrfnl Mar 10, 2023
4016273
README: enhance the TOC
jrfnl Jan 3, 2022
6d533df
Merge pull request #92 from Yoast/feature/readme-enhance-toc
jrfnl Mar 10, 2023
243f2c0
GH Actions: add new check for consistency in markdown files
jrfnl Mar 10, 2023
092d150
Docs: minimal changes to pass the markdownlint check
jrfnl Mar 10, 2023
5b01ae7
GH Actions: add new check with additional QA for markdown files
jrfnl Mar 10, 2023
b6d80f2
Docs: minimal changes to pass the remark check
jrfnl Mar 10, 2023
417de91
Merge pull request #93 from Yoast/feature/ghactions-add-markdown-brok…
jrfnl Mar 10, 2023
f593601
README: update links to PHPUnit docs
jrfnl Mar 11, 2023
a214350
Merge pull request #94 from Yoast/feature/readme-update-links
jrfnl Mar 11, 2023
e2e5a43
Tests: remove some duplicate code
jrfnl Mar 12, 2023
07ad708
Merge pull request #96 from Yoast/feature/tests-qa-simplify-some-code
jrfnl Mar 12, 2023
cc18f1b
AssertClosedResource: improve handling of custom error message
jrfnl Mar 12, 2023
dd6b6c1
AssertFileDirectory: improve handling of custom error message
jrfnl Mar 12, 2023
e873683
AssertStringContains: improve handling of custom error message
jrfnl Mar 12, 2023
981b266
Merge pull request #97 from Yoast/feature/improve-error-messages
jrfnl Mar 12, 2023
eab092b
GH Actions: Bump xt0rted/markdownlint-problem-matcher from 1 to 2
dependabot[bot] Mar 13, 2023
bb27ca0
Merge pull request #98 from Yoast/dependabot/github_actions/xt0rted/m…
jrfnl Mar 13, 2023
fe4bd4f
Updates for branch renames
jrfnl Mar 10, 2023
fe77f7a
README: add section about PHPUnit support
jrfnl Mar 10, 2023
6f7c1f6
Merge pull request #99 from Yoast/phpunit-10.0/updates-for-1.x-and-2.x
jrfnl Mar 30, 2023
857c550
Changelog for the 1.0.5 release
jrfnl Mar 13, 2023
494749c
Merge pull request #100 from Yoast/feature/changelog-1.0.5
jrfnl Mar 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
/.gitignore export-ignore
/.cache/ export-ignore
/.github/ export-ignore
/.markdownlint-cli2.yaml export-ignore
/.phpcs.xml.dist export-ignore
/.remarkignore export-ignore
/.remarkrc export-ignore
/phpunit.xml.dist export-ignore
/tests/ export-ignore

Expand Down
16 changes: 10 additions & 6 deletions .github/RELEASE-CHECKLIST.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,30 @@
Template to use for release PRs from `develop` to `main`
Template to use for release PRs from `#.x` to `main`
===========================================================

Title: Release version x.x.x

### Functional:
<!--
If both a 1.x and a 2.x release are to be tagged, always tag the 1.x release first!
-->

## Functional
- [ ] Confirm that the most recent PHPUnit changelogs have been checked and that the library is still feature complete for those versions supported within the PHPUnit version constraints.
- [ ] Update the `VERSION` constant in the `phpunitpolyfills-autoload.php` file.
- [ ] Composer: check if any dependencies/version constraints need updating.

### Release:
## Release
- [ ] Add changelog for the release - PR #xxx
Verify that a release link at the bottom of the `CHANGELOG.md` file has been added.
- [ ] Merge this PR.
- [ ] Make sure all CI builds are green.
- [ ] Tag the release (careful, GH defaults to `develop`!).
- [ ] Create a release from the tag (careful, GH defaults to `develop`!) & copy & paste the changelog to it.
- [ ] Tag the release (careful, GH defaults to `2.x`!).
- [ ] Create a release from the tag (careful, GH defaults to `2.x`!) & copy & paste the changelog to it.
Make sure to copy the links to the issues and the links to the GH usernames from the bottom of the changelog!
- [ ] Close the milestone.
- [ ] Open a new milestone for the next release.
- [ ] If any open PRs/issues which were milestoned for the release did not make it into the release, update their milestone.

### Announce:
## Announce
- [ ] Tweet about the release.


Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/cs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM-DD.
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

# Validate the composer.json file.
# @link https://getcomposer.org/doc/03-cli.md#validate
Expand All @@ -45,7 +45,7 @@ jobs:
# Check the code-style consistency of the PHP files.
- name: Check PHP code style
id: phpcs
run: composer check-cs -- --report-full --report-checkstyle=./phpcs-report.xml
run: composer check-cs -- --no-cache --report-full --report-checkstyle=./phpcs-report.xml

- name: Show PHPCS results in PR
if: ${{ always() && steps.phpcs.outcome == 'failure' }}
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ jobs:

strategy:
matrix:
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2']
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']

continue-on-error: ${{ matrix.php == '8.3' }}

name: "Lint: PHP ${{ matrix.php }}"

Expand All @@ -40,11 +42,20 @@ jobs:

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
- name: Install Composer dependencies - normal
if: matrix.php != '8.3'
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Install Composer dependencies - ignore PHP restrictions
if: matrix.php == '8.3'
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM-DD.
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
composer-options: --ignore-platform-req=php+
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: "Lint PHP files against parse errors - PHP < 7.0"
if: ${{ matrix.php < 7.0 }}
Expand Down
112 changes: 112 additions & 0 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
name: MarkDown

on:
# Run on all pushes and on all pull requests.
push:
pull_request:
# Also run this workflow every Monday at 6:00.
schedule:
- cron: '0 6 * * 1'
# Allow manually triggering the workflow.
workflow_dispatch:

# Cancels all previous workflow runs for the same branch that have not yet completed.
concurrency:
# The concurrency group contains the workflow name and the branch name.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
markdownlint:
name: 'Lint Markdown'
runs-on: ubuntu-latest

# Don't run the cronjob in this workflow on forks.
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'Yoast')

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

# This action also handles the caching of the dependencies.
# https://github.com/actions/setup-node
- name: Set up node and enable caching of dependencies
uses: actions/setup-node@v3
with:
node-version: '16'

# @link https://github.com/DavidAnson/markdownlint-cli2
# @link https://github.com/DavidAnson/markdownlint
- name: Install Markdownlint CLI2
run: npm install -g markdownlint-cli2

# @link https://github.com/marketplace/actions/problem-matcher-for-markdownlint-cli
- name: Enable showing issue in PRs
uses: xt0rted/markdownlint-problem-matcher@v2

- name: Check markdown with CLI2
run: markdownlint-cli2

remark:
name: 'QA Markdown'
runs-on: ubuntu-latest

# Don't run the cronjob in this workflow on forks.
if: github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'Yoast')

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

- name: Set up node and enable caching of dependencies
uses: actions/setup-node@v3
with:
node-version: '16'

# To make the command available on CLI, it needs to be installed globally.
- name: Install Remark CLI globally
run: npm install --global remark-cli --foreground-scripts true --fund false

# To allow for creating a custom config which references rules which are included
# in the presets, without having to install all rules individually, a local install
# works best (and installing the presets in the first place, of course).
#
# Note: the first group of packages are all part of the mono "Remark lint" repo.
# The second group of packages (heading-whitespace and down) are additional
# "external" rules/plugins.
- name: Install Remark rules locally
run: >
npm install --foreground-scripts true --fund false
remark-lint
remark-gfm
remark-preset-lint-consistent
remark-preset-lint-recommended
remark-preset-lint-markdown-style-guide
remark-lint-checkbox-content-indent
remark-lint-linebreak-style
remark-lint-no-empty-url
remark-lint-no-heading-like-paragraph
remark-lint-no-reference-like-url
remark-lint-no-unneeded-full-reference-image
remark-lint-no-unneeded-full-reference-link
remark-lint-strikethrough-marker
remark-lint-heading-whitespace
remark-lint-list-item-punctuation
remark-lint-match-punctuation
remark-lint-no-hr-after-heading
remark-lint-are-links-valid-alive
remark-lint-are-links-valid-duplicate
remark-validate-links

- name: Run Remark-lint
run: remark . --frail

# @link https://github.com/reviewdog/action-remark-lint
- name: Show Remark-lint annotations in PR
if: ${{ failure() && github.event_name == 'pull_request' }}
uses: reviewdog/action-remark-lint@v5
with:
fail_on_error: true
install_deps: false
level: info
reporter: github-pr-check
23 changes: 19 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,18 @@ jobs:
- php: '8.1'
phpunit: '9.3.0'
experimental: false
- php: '8.2'
phpunit: '9.3.0'
experimental: false

# Experimental builds.
- php: '8.3'
phpunit: 'auto' # PHPUnit 9.x.
experimental: true

- php: '8.1'
phpunit: '^10.0'
experimental: true

- php: '8.2'
phpunit: '^10.0'
experimental: true
Expand All @@ -89,11 +95,20 @@ jobs:

# Install dependencies and handle caching in one go.
# @link https://github.com/marketplace/actions/install-composer-dependencies
- name: Install Composer dependencies
- name: Install Composer dependencies - normal
if: matrix.php != '8.3'
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Install Composer dependencies - ignore PHP restrictions
if: matrix.php == '8.3'
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM-DD.
custom-cache-suffix: $(date -u -d "-0 month -$(($(date +%d)-1)) days" "+%F")
composer-options: --ignore-platform-req=php+
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Run the unit tests
if: ${{ matrix.phpunit != '^10.0' }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/composer.lock
node_modules/
vendor/
/.phpcs.xml
/phpcs.xml
Expand Down
107 changes: 107 additions & 0 deletions .markdownlint-cli2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#
# Configuration file for MarkdownLint-CLI2.
#
# Example file with all options:
# https://github.com/DavidAnson/markdownlint-cli2/blob/main/test/markdownlint-cli2-yaml-example/.markdownlint-cli2.yaml
#

# Do not fix any fixable errors.
fix: false

# Define glob expressions to use (only valid at root).
globs:
- "**/*.md"
- ".github/**/*.md"

# Define glob expressions to ignore.
ignores:
- "node_modules/"
- "vendor/"

# Disable inline config comments.
noInlineConfig: true

# Disable progress on stdout (only valid at root).
noProgress: false

# Adjust the configuration for some built-in rules.
# For full information on the options and defaults, see:
# https://github.com/DavidAnson/markdownlint/blob/main/schema/.markdownlint.yaml
config:
######################
# Disable a few rules.
######################
# MD003/heading-style/header-style - Heading style.
MD003: false
# MD031/blanks-around-fences - Fenced code blocks should be surrounded by blank lines.
MD031: false
# MD032/blanks-around-lists - Lists should be surrounded by blank lines.
MD032: false

##############################
# Customize a few other rules.
##############################
# MD004/ul-style - Unordered list style.
MD004:
# List style - each level has a different, but consistent symbol.
style: "sublist"

# MD007/ul-indent - Unordered list indentation.
MD007:
indent: 4
# Whether to indent the first level of the list.
start_indented: false

# MD012/no-multiple-blanks - Multiple consecutive blank lines.
MD012:
maximum: 2

# MD013/line-length - Line length.
MD013:
# Number of characters. No need for being too fussy.
line_length: 1000
# Number of characters for headings.
heading_line_length: 105
# Number of characters for code blocks.
code_block_line_length: 100
# Stern length checking (applies to tables, code blocks etc which have their own max line length).
stern: true

# MD022/blanks-around-headings/blanks-around-headers - Headings should be surrounded by blank lines
MD022:
# Blank lines below heading
lines_below: false

# MD024/no-duplicate-heading/no-duplicate-header - Multiple headings with the same content.
MD024:
# Only check sibling headings.
siblings_only: true

# MD033/no-inline-html - Inline HTML.
MD033:
# Allowed elements.
allowed_elements:
- br

# MD044/proper-names - Proper names should have the correct capitalization.
MD044:
# List of proper names.
names: ["PHPUnit"]
# Include code blocks.
code_blocks: false

# MD046/code-block-style - Code block style
MD046:
style: "fenced"

# MD048/code-fence-style - Code fence style
MD048:
style: "backtick"

# MD049/emphasis-style - Emphasis style should be consistent
MD049:
style: "underscore"

# MD050/strong-style - Strong style should be consistent
MD050:
style: "asterisk"
5 changes: 5 additions & 0 deletions .remarkignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Ignore rules for Remark.
# Docs: https://github.com/unifiedjs/unified-engine/blob/HEAD/doc/ignore.md

/node_modules/
/vendor/
Loading