Skip to content

Commit aa097bc

Browse files
committed
Merge pull request ev3dev#88 from WasabiFan/add-ci-config
Add Travis CI config
2 parents dbf9fe7 + 81f6d9f commit aa097bc

28 files changed

Lines changed: 159 additions & 92 deletions

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: ruby
2+
rvm:
3+
- 2.1
4+
5+
before_script:
6+
- chmod +x ./cibuild.sh # or do this locally and commit
7+
8+
# Assume bundler is being used, therefore
9+
# the `install` step will run `bundle install` by default.
10+
script: ./cibuild.sh
11+
12+
env:
13+
global:
14+
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ source 'https://rubygems.org'
22
gem 'github-pages'
33

44
require 'rbconfig'
5+
gem "html-proofer", :platforms => :ruby
56
gem 'wdm', '~> 0.1.0' if RbConfig::CONFIG['target_os'] =~ /mswin|mingw/i

_config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ exclude:
66
- Gemfile.lock
77
- repo-metadata.html
88
- publish.rb
9+
- vendor
10+
- cibuild.sh
11+
- .travis.yml
912

1013
gems:
1114
- jekyll-mentions

_includes/head.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<title>{{ page.title | xml_escape }}</title>
77
<link rel="alternate" type="application/atom+xml" href="/news/atom.xml" title="Atom feed">
8-
<link rel="icon" href="favicon.ico" />
8+
<link rel="icon" href="/favicon.ico" />
99

1010
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
1111
<link rel="stylesheet" href="/stylesheets/bootstrap.css">

_includes/header.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@
88
<span class="icon-bar"></span>
99
</button>
1010
<a class="navbar-brand" href="/">
11-
<img id="brand-logo" src="/images/ev3dev_logo_white.png" />
11+
<img id="brand-logo" src="/images/ev3dev_logo_white.png" alt="ev3dev logo" />
1212
</a>
1313
</div>
1414
<div class="collapse navbar-collapse">
15-
<ul class="nav navbar-nav">
15+
<ul class="nav navbar-nav" id="main-nav">
1616
<li>
1717
<a href="/" title="There's no place like Home...">Home</a>
1818
</li>
1919
<li class="dropdown">
20-
<a class="dropdown-toggle" data-toggle="dropdown" title="Documentation on how to use ev3dev">
20+
<a class="dropdown-toggle" href="#main-nav" data-toggle="dropdown" title="Documentation on using ev3dev">
2121
Docs
2222
<span class="caret"></span>
2323
</a>
@@ -45,7 +45,7 @@
4545
<a href="/news" title="News about ev3dev">News</a>
4646
</li>
4747
<li class="dropdown">
48-
<a class="dropdown-toggle" data-toggle="dropdown">
48+
<a class="dropdown-toggle" data-toggle="dropdown" href="#main-nav">
4949
Community
5050
<span class="caret"></span>
5151
</a>

_includes/inline-screenshot.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<div class="screenshot inline-screenshot pull-right">
22
<a href="{{ include.source }}">
3-
<img src="{{ include.source }}" />
3+
<img src="{{ include.source }}" alt="screenshot"/>
44
</a>
55
<p>
66
<small>

_includes/screenshot.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
source: The url of the image
88
caption: (optional) A caption that is displayed under the image.
99

10-
{% endcomment %}<span class="screenshot"><a href="{{ include.source }}"><img src="{{ include.source }}" alt="screenshot" class="img-responsive" /></a>{% if include.caption %}<p><small>{{ include.caption }}</small></p>{% endif %}</span>
10+
{% endcomment %}<span class="screenshot"><a href="{{ include.source }}"><img src="{{ include.source }}" class="img-responsive" alt="screenshot"/></a>{% if include.caption %}<p><small>{{ include.caption }}</small></p>{% endif %}</span>

_includes/title.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
{% assign edit_path = edit_path | append: '#L' | append: source_line %}
66
{% endif %}
77
{% elsif page.path contains 'docs/' %}
8-
{% assign edit_path = site.github.repository_url | append: '/edit/master/' | append: page.path %}
8+
{% if site.github.repository_url %}
9+
{% assign repo_url = site.github.repository_url %}
10+
{% else %}
11+
{% assign repo_url = 'https://github.com/ev3dev/ev3dev.github.io' %}
12+
{% endif %}
13+
{% assign edit_path = repo_url | append: '/edit/master/' | append: page.path %}
914
{% elsif page.path contains 'news/' %}
1015
{% assign show_news_link = 1 %}
1116
{% endif %}

cibuild.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
set -e # halt script on error
3+
4+
echo "Searching for BOMs -------------------------------"
5+
6+
FOUND_BOM=false
7+
for filename in ./**/*.*; do
8+
# Make sure that the file is UTF-8 so we don't search binary files or other encodings
9+
CURRENT_FILE_ENCODING="`file --mime-encoding --brief "$filename"`"
10+
if [ "$CURRENT_FILE_ENCODING" == "utf-8" ] && [ "`head -c 3 -- "$filename"`" == $'\xef\xbb\xbf' ]
11+
then
12+
# Make note of all the files that failed so we can see it in the Travis log
13+
FOUND_BOM=true
14+
echo "Found BOM in file $filename!"
15+
fi
16+
done
17+
18+
if [ $FOUND_BOM == true ]
19+
then
20+
# We still want to run the other validation checks even if we found BOMs
21+
echo "Checks failed! Jekyll can't handle BOMs. See above for list of problematic files."
22+
else
23+
echo "Checks passed! No BOMs found."
24+
fi
25+
26+
echo "Building site ------------------------------------"
27+
bundle exec jekyll build --trace
28+
29+
echo "Validating HTML ----------------------------------"
30+
# We want to use the publish script so that we can implement other transformations in the future
31+
ruby publish.rb --no-fix-links --test 'htmlproof ./ --href-ignore /.*example\.com.*/ --check-html --ignore-script-embeds'
32+
33+
# If the site build succeeded but we found BOMs, we want to fail the build
34+
if [ $FOUND_BOM == true ]
35+
then
36+
exit 1
37+
fi

docs/drivers/brickpi-i2c-sensor.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ the [lego-sensor class] which is where the useful stuff is. Follow the link
2121
for more information.
2222

2323
[brickpi]: /docs/drivers/brickpi-ld
24-
[brickpi-in-port]: /docs/ports/brickpi-port
24+
[brickpi-in-port]: /docs/ports/brickpi-in-port
2525
[list of supported sensors]: /docs/sensors#supported-sensors
2626
[lego-sensor class]: ../lego-sensor-class
2727

0 commit comments

Comments
 (0)