Skip to content

Commit 163afe8

Browse files
Add option to locally run HTMLProofer (#2285)
* Add Ruby installation and html-proofer gem to devcontainer Add Ruby installation and html-proofer gem to devcontainer Add Ruby installation and html-proofer gem to devcontainer * Update the Check links action with the new Gemfile * Fix "Set up Ruby" Github Action Co-authored-by: Sam <[email protected]> * Add x86_64-linux as a platfiorm for Ruby on Ubuntu (Github Action) * Add bundle install after Ruby setup * Update .github/workflows/ubuntu.yml * Fix "Set up Ruby" Github Action indentation Co-authored-by: Sam <[email protected]> * Fix htmlproofer command in CI --------- Co-authored-by: Nick Spaargaren <[email protected]> Co-authored-by: Sam <[email protected]>
1 parent 684d457 commit 163afe8

File tree

4 files changed

+63
-6
lines changed

4 files changed

+63
-6
lines changed

.devcontainer/devcontainer.json

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
2-
"name": "Python 3",
2+
"name": "Python and Ruby",
33
"image": "mcr.microsoft.com/devcontainers/python:1-3.9-bookworm",
4-
"postCreateCommand": "pip3 install --user -r requirements.txt"
4+
"features": {
5+
"ghcr.io/devcontainers/features/ruby:1": {
6+
"version": "3.4.1"
7+
}
8+
},
9+
"postCreateCommand": "pip3 install --user -r requirements.txt && bundle install"
510
}

.github/workflows/ubuntu.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ jobs:
3030
path: ${{ env.pythonLocation }}
3131
key: v2-${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}
3232

33-
- name: Install html-proofer
34-
run: sudo gem install html-proofer -v '<4.4'
35-
3633
- name: Install dependencies
3734
run: |
3835
python -m pip install --upgrade pip wheel
@@ -56,9 +53,18 @@ jobs:
5653
with:
5754
name: html
5855
path: html.tar.gz
56+
57+
- name: Set up Ruby
58+
uses: ruby/setup-ruby@v1
59+
with:
60+
ruby-version: '3.4'
61+
bundler-cache: true
62+
63+
- name: Install Ruby dependencies
64+
run: bundle install
5965

6066
# TODO: Look into why we need to ignore archive/tag/index
6167
- name: Check links
6268
if: success()
6369
run: |
64-
htmlproofer --ignore-files "/404/,/2013/,/2014/,/2015/,/2016/,/2017/,/search\/index.html/,/archive\/tag\/index/" --allow-hash-href=true --enforce-https=false --ignore-missing-alt=true --disable-external=true docs/_build/html
70+
bundle exec htmlproofer --ignore-files "/404/,/2013/,/2014/,/2015/,/2016/,/2017/,/search\/index.html/,/archive\/tag\/index/" --allow-hash-href=true --enforce-https=false --ignore-missing-alt=true --disable-external=true docs/_build/html

Gemfile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# frozen_string_literal: true
2+
3+
source "https://rubygems.org"
4+
5+
gem "html-proofer", '<4.4'

Gemfile.lock

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
addressable (2.8.7)
5+
public_suffix (>= 2.0.2, < 7.0)
6+
ethon (0.16.0)
7+
ffi (>= 1.15.0)
8+
ffi (1.17.1-aarch64-linux-gnu)
9+
ffi (1.17.1-x86_64-linux-gnu)
10+
html-proofer (4.3.2)
11+
addressable (~> 2.3)
12+
mercenary (~> 0.3)
13+
nokogiri (~> 1.13)
14+
parallel (~> 1.10)
15+
rainbow (~> 3.0)
16+
typhoeus (~> 1.3)
17+
yell (~> 2.0)
18+
zeitwerk (~> 2.5)
19+
mercenary (0.4.0)
20+
nokogiri (1.18.1-aarch64-linux-gnu)
21+
racc (~> 1.4)
22+
nokogiri (1.18.1-x86_64-linux-gnu)
23+
racc (~> 1.4)
24+
parallel (1.26.3)
25+
public_suffix (6.0.1)
26+
racc (1.8.1)
27+
rainbow (3.1.1)
28+
typhoeus (1.4.1)
29+
ethon (>= 0.9.0)
30+
yell (2.2.2)
31+
zeitwerk (2.7.1)
32+
33+
PLATFORMS
34+
aarch64-linux-gnu
35+
x86_64-linux
36+
37+
DEPENDENCIES
38+
html-proofer (< 4.4)
39+
40+
BUNDLED WITH
41+
2.6.2

0 commit comments

Comments
 (0)