diff options
author | Tulio Leao <tupaschoal@gmail.com> | 2020-04-09 16:26:26 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 16:26:26 -0300 |
commit | 3deec4cc48e3acac249db3d3c78c1d14af116c6a (patch) | |
tree | 57ff7c11ebcbdd356e7b81474358f978ea076b64 | |
parent | a748cd395ef1a9cb089650260766c9cbfdb6797d (diff) |
Speed up Travis CI and improve error reports (#467)
-rw-r--r-- | .travis.yml | 19 | ||||
-rwxr-xr-x | script/check_files_formatting.sh | 20 | ||||
-rwxr-xr-x | script/cibuild | 24 | ||||
-rwxr-xr-x | script/run_jekyll.sh | 6 |
4 files changed, 44 insertions, 25 deletions
diff --git a/.travis.yml b/.travis.yml index 853b4f89..aadd5006 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,22 @@ +os: linux +dist: bionic language: ruby rvm: - 2.6.5 - -# Assume bundler is being used, therefore -# the `install` step will run `bundle install` by default. -script: ./script/cibuild +cache: bundler env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer -sudo: false +jobs: + include: + - stage: Run Tests + script: ./script/run_jekyll.sh + name: "Run jekyll" + - script: ./script/validate_json.rb + name: "Validate JSON" + - script: ./script/ping_websites.rb + name: "Ping websites" + - script: ./script/check_files_formatting.sh + name: "Check Files Formatting" diff --git a/script/check_files_formatting.sh b/script/check_files_formatting.sh new file mode 100755 index 00000000..11afd2c3 --- /dev/null +++ b/script/check_files_formatting.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -e # halt script on error + +# Validate all files adhere to .editorconfig +# Exclude files which should not be checked against .editorconfig +# (eg. images, LICENSE, system-generated files, and library files) +mapfile -t editorconfigargs < <( + find . \ + -type 'f' \ + ! -name '*.png' \ + ! -name '*.ico' \ + ! -name 'LICENSE' \ + ! -name 'Gemfile.lock' \ + ! -path './assets/*/libs/*' \ + ! -path './.bundle/*' \ + ! -path './.git/*' \ + ! -path './_site/*' \ + ! -path './vendor/*' \ +) +npx @htmlacademy/editorconfig-cli "${editorconfigargs[@]}" diff --git a/script/cibuild b/script/cibuild index 47c32708..55657043 100755 --- a/script/cibuild +++ b/script/cibuild @@ -1,28 +1,12 @@ #!/usr/bin/env bash set -e # halt script on error -# Build site, validate HTML -bundle exec jekyll build -bundle exec htmlproofer ./_site --checks-to-ignore 'LinkCheck' +# Run jekyll +./script/run_jekyll.sh # Validate JSON ./script/validate_json.rb ./script/ping_websites.rb -# Validate all files adhere to .editorconfig -# Exclude files which should not be checked against .editorconfig -# (eg. images, LICENSE, system-generated files, and library files) -mapfile -t editorconfigargs < <( - find . \ - -type 'f' \ - ! -name '*.png' \ - ! -name '*.ico' \ - ! -name 'LICENSE' \ - ! -name 'Gemfile.lock' \ - ! -path './assets/*/libs/*' \ - ! -path './.bundle/*' \ - ! -path './.git/*' \ - ! -path './_site/*' \ - ! -path './vendor/*' \ -) -npx @htmlacademy/editorconfig-cli "${editorconfigargs[@]}" +# Check if files are properly formatted +./script/check_files_formatting.sh diff --git a/script/run_jekyll.sh b/script/run_jekyll.sh new file mode 100755 index 00000000..0bf5ccf1 --- /dev/null +++ b/script/run_jekyll.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -e # halt script on error + +# Build site, validate HTML +bundle exec jekyll build +bundle exec htmlproofer ./_site --checks-to-ignore 'LinkCheck' |