-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #277 from jrha/github_actions
Rework old TravisCI test config to GitHub actions
- Loading branch information
Showing
9 changed files
with
90 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Run Tests | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
runtests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@ec02537da5712d66d4d50a0f33b7eb52773b5ed1 | ||
with: | ||
bundler-cache: true | ||
ruby-version: '3.1' | ||
- name: Set up Python 3 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3 | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pyenchant | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 250 | ||
- name: Install Ruby gems | ||
run: bundle install | ||
env: | ||
NOKOGIRI_USE_SYSTEM_LIBRARIES: true # speeds up installation of html-proofer | ||
- name: Build with Jekyll | ||
uses: actions/jekyll-build-pages@v1 | ||
with: | ||
source: ./ | ||
destination: ./_site | ||
- name: Check Spelling | ||
run: .tests/spellchecker | ||
- name: Check HTML | ||
run: .tests/htmlproofer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
_site | ||
*~ | ||
Gemfile.lock | ||
vendor/ | ||
|
||
# Eclipse project | ||
.project | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env bash | ||
set -e # halt script on error | ||
|
||
SCVERSION="1.4" | ||
|
||
wget https://github.com/stfc/markdown-spellchecker/archive/$SCVERSION.tar.gz -O /tmp/spellchecker.tar.gz | ||
(cd /tmp && tar -xvzf spellchecker.tar.gz) | ||
|
||
cp -f .tests/dictionary.txt /tmp/markdown-spellchecker-$SCVERSION/src/dict.txt | ||
|
||
echo | ||
echo spellchecker config: | ||
echo -------------------- | ||
cat /tmp/markdown-spellchecker-$SCVERSION/src/config.ini | ||
echo -------------------- | ||
echo | ||
|
||
commit_range="HEAD^..HEAD" | ||
|
||
echo "Commit Range: ${commit_range}" | ||
|
||
# Ignore deleted files | ||
md_files="$(git diff --name-only --diff-filter=d "${commit_range}" -- | grep '\.md$' | grep -v '^assets/' || true)" | ||
|
||
if [[ -n "$md_files" ]]; then | ||
echo "Markdown files changed:" | ||
#shellcheck disable=SC2001 | ||
echo "$md_files" | sed 's/^/ /g' | ||
echo "Running markdown-spellchecker:" | ||
python3 /tmp/markdown-spellchecker-$SCVERSION/src/spellchecker.py $md_files || exit 1 | ||
exit 0 | ||
else | ||
echo "No markdown files changed, nothing to do." | ||
exit 0 | ||
fi |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,3 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'github-pages', '>= 175' | ||
gem 'jekyll-feed' | ||
gem 'jekyll-redirect-from' | ||
gem 'html-proofer', '~> 3' | ||
|
||
# Suggested by Jekyll | ||
gem 'wdm', '>= 0.1.0' if Gem.win_platform? | ||
ruby "~> 3" | ||
gem 'html-proofer', '~> 4' |