Skip to content

Build: migrate CI from Travis to GitHub Actions#43

Closed
dd32 wants to merge 10 commits into
bbpress:trunkfrom
dd32:add/github-actions-ci
Closed

Build: migrate CI from Travis to GitHub Actions#43
dd32 wants to merge 10 commits into
bbpress:trunkfrom
dd32:add/github-actions-ci

Conversation

@dd32
Copy link
Copy Markdown

@dd32 dd32 commented May 20, 2026

Summary

Replaces the legacy .travis.yml with two GitHub Actions workflows and fixes a small handful of issues uncovered along the way.

.github/workflows/test.yml — PHPUnit

  • Matrix across PHP 7.4, 8.0, 8.1, 8.2, 8.3, 8.4, 8.5 against WordPress trunk
  • PHP 8.5 marked experimental (continue-on-error) so it surfaces results without gating
  • MariaDB 11 service container
  • Plugin checked out into wordpress-develop/src/wp-content/plugins/bbpress/ so WP_DEVELOP_DIR resolves the way tests/phpunit/includes/define-constants.php expects
  • Composer dependencies cached per PHP version
  • BuddyPress clone dropped — phpunit.xml.dist already excludes the buddypress group

.github/workflows/lint.yml — PHPCS + JS

  • phpcs job on PHP 8.4 with cs2pr-driven PR annotations and a full text report in the log
  • On pull_request events only changed PHP files are scanned (git diff base.sha HEAD -- '*.php'); pushes still scan the full tree
  • js-lint job runs ESLint + checktextdomain on Node 24

Test/code/config fixes uncovered by the new CI

  • Drop a stale setExpectedDeprecated( 'seems_utf8' ) from three author-template tests — after r7393 (bbp_format_user_display_name() preferring wp_is_valid_utf8() when available) the deprecation path is unreachable on modern WP, so the expectation never fires
  • phpcs.xml.dist: explicitly accept bbp as the project prefix (WPCS 3.0+ raises ShortPrefixPassed for prefixes under 4 chars) and set ignore_warnings_on_exit=1 so warnings keep showing up in reports without flipping the exit code
  • Reformat 20 converter unserialize() and 2 hash_equals() calls added in r7461 so they pass WPCS multi-line function-call rules
  • Replace node-sass (unmaintained, no Node 24 prebuilt binary) with the official sass (dart-sass) package, updating Gruntfile.js and regenerating package-lock.json

CI infrastructure

  • Pinned action majors to their current versions: actions/checkout@v6, actions/setup-node@v6, actions/cache@v5. These run on Node.js 24 internally, clearing the Node 20 deprecation warnings GitHub is enforcing in June 2026.
  • shivammathur/setup-php@v2 remains on its active major.

Test plan

  • PHPUnit matrix green on PHP 7.4 – 8.5 against WP trunk (Tests: 662, Assertions: 1107, Incomplete: 374)
  • PHPCS lint green
  • ESLint + checktextdomain green on Node 24
  • npm install clean on Node 24 with dart-sass
  • grunt sass:colors still compiles the admin color schemes (emits @import deprecation warnings from dart-sass — future cleanup, not a regression)

🤖 Generated with Claude Code

dd32 and others added 10 commits May 20, 2026 03:41
Add PHPUnit matrix (PHP 7.4–8.5 against WordPress trunk, MariaDB 11
service) and a lint workflow covering PHPCS, ESLint, and checktextdomain.
PHP 8.5 is flagged experimental and allowed to fail.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bbp_format_user_display_name() now prefers wp_is_valid_utf8() (WP 6.9+)
and mb_check_encoding() ahead of the seems_utf8() fallback, so on modern
environments the deprecated function is never called. The expectation
became stale after r7393. Also pin lint workflow to PHP 8.4.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
WPCS 3.0+ raises ShortPrefixPassed for prefixes under 4 chars. "bbp" is
the deliberately chosen project prefix, so suppress the sub-sniff via
severity=0 instead of excluding a single file.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Splits the multi-line unserialize() and hash_equals() calls added in
r7461 across one argument per line so WPCS' multi-line function-call
rules are satisfied; also drops two stray trailing spaces.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
PHPCS now writes a full text report to the job log alongside the
checkstyle output cs2pr converts into PR annotations, so file/line
context is visible directly in the workflow output. On pull_request
events the scan is limited to changed PHP files; pushes still scan the
full tree.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sets ignore_warnings_on_exit=1 so warnings (e.g. notices about
deprecated WP functions still used as fallbacks) keep appearing in
reports but no longer flip the exit code to 1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
GitHub is removing Node 20 from runners in September 2026; pin the
ESLint/grunt job to Node 24 so it stays on a supported runtime.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumps actions/checkout@v4 to v6, actions/setup-node@v4 to v6, and
actions/cache@v4 to v5. These majors run on Node.js 24 internally,
clearing the deprecation warnings that v4 was triggering ahead of
GitHub removing Node.js 20 from runners. shivammathur/setup-php remains
on v2 (still the actively maintained major).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
node-sass has no prebuilt binary for Node 24 and its build-from-source
fallback fails too, blocking npm ci before ESLint or checktextdomain
get a chance to run. The lint job doesn't compile sass, so installing
with --ignore-scripts gets the eslint/grunt binaries into place without
the broken postinstall.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
node-sass is unmaintained and ships no prebuilt binary for Node 24,
breaking npm ci on a modern toolchain. Switch the grunt-sass
implementation to the official dart-sass package and regenerate the
lockfile; also drop the temporary --ignore-scripts workaround from the
lint workflow now that the install is clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@renatonascalves renatonascalves left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code looks good. I don't have access to set up github actions here but @JJJ probably do.

@renatonascalves
Copy link
Copy Markdown

@dd32 I think you need a ticket too. Just noticed it's missing.

@JJJ
Copy link
Copy Markdown
Contributor

JJJ commented May 20, 2026

Exported the .diff, manually committed to trunk in: https://bbpress.trac.wordpress.org/changeset/7407

@JJJ JJJ closed this May 20, 2026
dd32 pushed a commit that referenced this pull request May 20, 2026
Replaces the legacy `.travis.yml` with two GitHub Actions workflows, and fixes a small handful of issues uncovered along the way.

In trunk, for 2.7.

Props dd32.

Fixes: #43

git-svn-id: https://bbpress.svn.wordpress.org/trunk@7407 9866e705-20ec-0310-96e7-cbb4277adcfb
dd32 pushed a commit that referenced this pull request May 20, 2026
…ime()` float.

Fixes the PHP 8.1+ `Implicit conversion from float to int loses precision` deprecation notice, emitted every time the Akismet history metabox renders for a topic or reply.

In trunk, for 2.7.

Props dd32.

Fixes: #3671.

From: #43

git-svn-id: https://bbpress.svn.wordpress.org/trunk@7408 9866e705-20ec-0310-96e7-cbb4277adcfb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants