Skip to content
This repository has been archived by the owner on Jul 29, 2022. It is now read-only.

Commit

Permalink
Adding HTMLProofer to Travis build
Browse files Browse the repository at this point in the history
Signed-off-by: Lars Marowsky-Bree <[email protected]>
  • Loading branch information
l-mb committed Apr 23, 2021
1 parent a75d5b2 commit 43e7877
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
language: ruby
rvm:
- 2.3
script: bundle exec jekyll build
- 2.7
script:
- bundle exec jekyll build
- bundle exec rake test

cache:
directories:
- $TRAVIS_BUILD_DIR/tmp/.htmlproofer #https://github.com/gjtorikian/html-proofer/issues/381

env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer

addons:
apt:
packages:
- libcurl4-openssl-dev # required to avoid SSL errors

sudo: false

deploy:
provider: pages
skip_cleanup: true
Expand Down
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ group :jekyll_plugins do
gem "kramdown", ">= 2.3.0"
gem "rake"
end

group :test do
gem 'html-proofer'
end
25 changes: 25 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
abort('Please run this using `bundle exec rake`') unless ENV["BUNDLE_BIN_PATH"]
require 'html-proofer'

desc "Test the website"
task :test do
sh "bundle exec jekyll build"
options = {
:check_sri => true,
:check_external_hash => true,
:check_html => true,
:check_img_http => true,
:check_opengraph => true,
:enforce_https => true,
:cache => {
:timeframe => '6w'
}
}
begin
HTMLProofer.check_directory("_site/", options).run
rescue => msg
puts "#{msg}"
end
end

task :default => [:test]
5 changes: 5 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ header_pages:
- FAQ.md
- LICENSE.md

exclude:
- Gemfile
- Gemfile.lock
- Rakefile

collections:
minutes:
output: true

0 comments on commit 43e7877

Please sign in to comment.