Skip to content

Commit

Permalink
Spellcheck and add GitHub Action for repo (#23)
Browse files Browse the repository at this point in the history
* Spellcheck and add GitHub Action for repo

* Add lesson checks
ocaisa authored Aug 5, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 4c7d6b8 commit 4e97d6b
Showing 6 changed files with 31 additions and 54 deletions.
68 changes: 22 additions & 46 deletions .github/workflows/template.yml → .github/workflows/lesson.yml
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
2 changes: 1 addition & 1 deletion _episodes/03-types.md
Original file line number Diff line number Diff line change
@@ -68,7 +68,7 @@ true
~~~
{: .language-julia}

All the other types are _abstract_ types that are used to adress groups of types.
All the other types are _abstract_ types that are used to address groups of types.
For example, if we declare a variable as `a::Real` then it can be bound to any value that is a subtype of `Real`.

Let's quickly check what are all the subtypes of `Real`:
4 changes: 2 additions & 2 deletions _episodes/04-pkg.md
Original file line number Diff line number Diff line change
@@ -4,14 +4,14 @@ teaching: 20
exercises: 0
questions:
- "Where do I find packages?"
- "How do I add pacakges?"
- "How do I add packages?"
- "How can I use packages?"
objectives:
- "Learn to add packages using pkg-mode"
- "Learn to resolve name conflicts"
- "Learn to activate environments"
keypoints:
- "Find pacakges on juliahub"
- "Find packages on juliahub"
- "add packages using `pkg> add`"
- "use many small environments rather than one big environment"
---
2 changes: 1 addition & 1 deletion _episodes/06-control-flow.md
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ questions:
objectives:
keypoints:
- "Interfaces are informal"
- "Use for loops for a known number of iterations and while loops for an unkown number of iterations."
- "Use for loops for a known number of iterations and while loops for an unknown number of iterations."
---

{% include links.md %}
4 changes: 2 additions & 2 deletions _episodes/07-modules.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ title: "using Modules"
teaching: 30
exercises: 0
questions:
- "Whats the purpose of modules?"
- "What's the purpose of modules?"
objectives:
- "Structure your code using modules"
- "Use Revise.jl to track changes"
@@ -155,7 +155,7 @@ If she changes the code in the module, reincludes the module and runs her code a

## Revise.jl

`Revise.jl` is a pacakge that can keep track of changes in your files and load these in a running julia session.
`Revise.jl` is a package that can keep track of changes in your files and load these in a running julia session.

Melissa needs to take two things into account
- `using Revise` must come before `using` any Package that she wants to be tracked
5 changes: 3 additions & 2 deletions _episodes/09-tests.md
Original file line number Diff line number Diff line change
@@ -48,10 +48,11 @@ With this Melissa can run her test using the pkg mode of the REPL:

Melissa needed to add `Test` to her package in order to run the code above, but actually `Test` is not needed for her package other than testing.
Thus it is possible to move the `Test` entry in the `Project.toml` file from `[deps]` to an `[extras]` section and then add another entry
```
~~~
[targets]
test = ["Test"]
```
~~~
{: .language-julia}
Check out the [sample project file](../code/Project.toml) for a complete example.

> ## Create a test for MelissasModule

0 comments on commit 4e97d6b

Please sign in to comment.