Skip to content

Conversation

@yasulab
Copy link
Member

@yasulab yasulab commented Sep 3, 2025

This PR enables to check broken links/images/scripts/OGP/favicon and existing test-directory-structure test in one html-proofer's test report by using custom tests.

Also this PR enable to run bundle exec rake test in CI.

- name: 🔧 Build & Test
  run: |
    JEKYLL_ENV=production bundle exec jekyll build
    JEKYLL_ENV=production bundle exec jekyll doctor
    SKIP_BUILD=true       bundle exec rake test

📝 NOTE: jekyll build generates HTML so rake test can skip building it again.

Example CI report with Failure

$ bundle exec rake test

...

Running 6 checks (CustomChecks, Favicon, Images, Links, OpenGraph, Scripts) in ["_site"] on *.html files ...

	checking ... /404
	checking ... /code-of-conduct/index
	checking ... /contests/how-to-apply/index
	checking ... /contests/how-to-apply
	checking ... /contests/index
	checking ... /contests/terms/index
	checking ... /contests/terms
	checking ... /events/index
	checking ... /events/saikyo-coderdojo/index
	checking ... /index
	checking ... /news/index
	checking ... /privacy/index
	checking ... /registration/index
	checking ... /sessions/keynote1/index
	checking ... /sessions/keynote2/index
	checking ... /sponsorship/index
	checking ... /sponsorship/list/index
	checking ... /staff/index
	checking ... /test-temp

Checking 21 internal links
Checking internal link hashes in 1 file
Ran on 19 files!


For the CustomChecks check, the following failures were found:

* At _site/test-temp.html:

  index.html でない HTML ファイルが生成されました:
  File: _site/test-temp.html
  すべてのページは index.html として生成される必要があります。
  これにより /path/ と /path の両方でルーティングが可能になります。

HTML-Proofer found 1 failure!

Example CI report with Success

$ bundle exec rake test

...

	checking ... /404
	checking ... /code-of-conduct/index
	checking ... /contests/how-to-apply/index
	checking ... /contests/how-to-apply
	checking ... /contests/index
	checking ... /contests/terms/index
	checking ... /contests/terms
	checking ... /events/index
	checking ... /events/saikyo-coderdojo/index
	checking ... /index
	checking ... /news/index
	checking ... /privacy/index
	checking ... /registration/index
	checking ... /sessions/keynote1/index
	checking ... /sessions/keynote2/index
	checking ... /sponsorship/index
	checking ... /sponsorship/list/index
	checking ... /staff/index

Checking 21 internal links
Checking internal link hashes in 1 file
Ran on 18 files!

HTML-Proofer finished successfully.

@yasulab yasulab changed the title Merge test-directory-structure test into HTML Proofer's custom checks Merge test-directory-structure test into HTML Proofer's custom checks and run it in CI Sep 3, 2025
Copy link
Collaborator

@kp54 kp54 left a comment

Choose a reason for hiding this comment

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

LGTM
ありがとうございます!

@kp54 kp54 merged commit 7461c20 into main Sep 3, 2025
2 checks passed
@kp54 kp54 deleted the merge-test-suites-to-html-proofer branch September 3, 2025 14:24
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