generated from carpentries-incubator/template
-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Spellcheck and add GitHub Action for repo (#23)
* Spellcheck and add GitHub Action for repo * Add lesson checks
ocaisa
authored
Aug 5, 2021
1 parent
4c7d6b8
commit 4e97d6b
Showing
6 changed files
with
31 additions
and
54 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 |
---|---|---|
@@ -1,26 +1,17 @@ | ||
name: Template | ||
name: Check spelling and build site | ||
on: | ||
push: | ||
branches: gh-pages | ||
pull_request: | ||
jobs: | ||
check-template: | ||
name: Test lesson template | ||
if: github.repository == 'carpentries/styles' | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
lesson: [swcarpentry/shell-novice, datacarpentry/r-intro-geospatial, librarycarpentry/lc-git] | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
defaults: | ||
run: | ||
shell: bash # forces 'Git for Windows' on Windows | ||
env: | ||
RSPM: 'https://packagemanager.rstudio.com/cran/__linux__/bionic/latest' | ||
build-lesson: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout the lesson | ||
uses: actions/checkout@master | ||
|
||
- name: Set up Ruby | ||
uses: actions/setup-ruby@main | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: '2.7.1' | ||
|
||
|
@@ -41,36 +32,8 @@ jobs: | |
python -m pip install --upgrade pip setuptools wheel pyyaml==5.3.1 requests | ||
fi | ||
- name: Checkout the ${{ matrix.lesson }} lesson | ||
uses: actions/checkout@master | ||
with: | ||
repository: ${{ matrix.lesson }} | ||
path: lesson | ||
fetch-depth: 0 | ||
|
||
- name: Determine the proper reference to use | ||
id: styles-ref | ||
run: | | ||
if [[ -n "${{ github.event.pull_request.number }}" ]]; then | ||
echo "::set-output name=ref::refs/pull/${{ github.event.pull_request.number }}/head" | ||
else | ||
echo "::set-output name=ref::gh-pages" | ||
fi | ||
- name: Sync lesson with carpentries/styles | ||
working-directory: lesson | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "The Carpentries Bot" | ||
git remote add styles https://github.com/carpentries/styles.git | ||
git config --local remote.styles.tagOpt --no-tags | ||
git fetch styles ${{ steps.styles-ref.outputs.ref }}:styles-ref | ||
git merge -s recursive -Xtheirs --no-commit styles-ref | ||
git commit -m "Sync lesson with carpentries/styles" | ||
- name: Look for R-markdown files | ||
id: check-rmd | ||
working-directory: lesson | ||
run: | | ||
echo "::set-output name=count::$(shopt -s nullglob; files=($(find . -iname '*.Rmd')); echo ${#files[@]})" | ||
|
@@ -114,5 +77,18 @@ jobs: | |
eval sudo $cmd | ||
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "18.04"), sep = "\n")') | ||
- run: make site | ||
working-directory: lesson | ||
- name: Check spelling | ||
uses: codespell-project/actions-codespell@master | ||
with: | ||
skip: bin | ||
ignore_words_list: rouge | ||
|
||
- name: "Check build" | ||
run: | | ||
make --always-make site | ||
- name: "Check lesson for warnings" | ||
run: | | ||
make lesson-check-all | ||
- name: "Check lesson for errors" | ||
run: | | ||
make lesson-check |
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
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
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