diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..87b2565 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,17 @@ +name: HTMLProofer +on: [push, pull_request] +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: ['2.7', '3.0'] + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - name: Run tests + run: bundle exec rake \ No newline at end of file diff --git a/Gemfile b/Gemfile index 6d5ab76..f59b1ba 100644 --- a/Gemfile +++ b/Gemfile @@ -28,3 +28,5 @@ end # Performance-booster for watching directories on Windows gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin] + +gem "html-proofer", "~> 3.18" diff --git a/Gemfile.lock b/Gemfile.lock index cc557b0..8928c3c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,9 +8,19 @@ GEM em-websocket (0.5.2) eventmachine (>= 0.12.9) http_parser.rb (~> 0.6.0) + ethon (0.12.0) + ffi (>= 1.3.0) eventmachine (1.2.7) ffi (1.14.2) forwardable-extended (2.6.0) + html-proofer (3.18.8) + addressable (~> 2.3) + mercenary (~> 0.3) + nokogumbo (~> 2.0) + parallel (~> 1.3) + rainbow (~> 3.0) + typhoeus (~> 1.3) + yell (~> 2.0) http_parser.rb (0.6.0) i18n (1.8.9) concurrent-ruby (~> 1.0) @@ -50,9 +60,18 @@ GEM jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) + nokogiri (1.11.1-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.11.1-x86_64-linux) + racc (~> 1.4) + nokogumbo (2.0.4) + nokogiri (~> 1.8, >= 1.8.4) + parallel (1.20.1) pathutil (0.16.2) forwardable-extended (~> 2.6) public_suffix (4.0.6) + racc (1.5.2) + rainbow (3.0.0) rb-fsevent (0.10.4) rb-inotify (0.10.1) ffi (~> 1.0) @@ -63,12 +82,17 @@ GEM ffi (~> 1.9) terminal-table (2.0.0) unicode-display_width (~> 1.1, >= 1.1.1) + typhoeus (1.4.0) + ethon (>= 0.9.0) unicode-display_width (1.7.0) + yell (2.2.2) PLATFORMS + x86_64-darwin-19 x86_64-linux DEPENDENCIES + html-proofer (~> 3.18) jekyll (~> 4.2.0) jekyll-feed (~> 0.12) minima (~> 2.5) diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..9bbfb78 --- /dev/null +++ b/Rakefile @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require 'html-proofer' + +task default: :check + +desc 'Clean out _site' +task :clean do + sh 'rm -rf _site' +end + +desc 'Preview site' +task watch: :clean do + sh 'jekyll serve --watch' +end + +desc 'Build site' +task build: :clean do + sh 'jekyll build' +end + +desc 'Run HTMLProofer on _site' +task check: :build do + options = { + check_html: true, + allow_hash_href: true, + assume_extension: true, + typhoeus: { + headers: { "User-Agent": 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:86.0) Gecko/20100101 Firefox/86.0' } + } + } + HTMLProofer.check_directory('./_site', options).run +end