Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyhodges committed Feb 1, 2021
0 parents commit 9adbd18
Show file tree
Hide file tree
Showing 60 changed files with 3,125 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
indent_size = 2
indent_style = space
max_line_length = 100 # Please keep this in sync with bin/lesson_check.py!

[*.r]
max_line_length = 80

[*.py]
indent_size = 4
indent_style = space
max_line_length = 79

[*.sh]
end_of_line = lf

[Makefile]
indent_style = tab
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: [carpentries, swcarpentry, datacarpentry, librarycarpentry]
custom: ["https://carpentries.wedid.it"]
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<details>
<summary><strong>Instructions</strong></summary>

Thanks for contributing! :heart:

If this contribution is for instructor training, please email the link to this contribution to
[email protected] so we can record your progress. You've completed your contribution
step for instructor checkout by submitting this contribution!

If this issue is about a specific episode within a lesson, please provide its link or filename.

Keep in mind that **lesson maintainers are volunteers** and it may take them some time to
respond to your contribution. Although not all contributions can be incorporated into the lesson
materials, we appreciate your time and effort to improve the curriculum. If you have any questions
about the lesson maintenance process or would like to volunteer your time as a contribution
reviewer, please contact The Carpentries Team at [email protected].

You may delete these instructions from your comment.

\- The Carpentries
</details>
19 changes: 19 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<details>
<summary><strong>Instructions</strong></summary>

Thanks for contributing! :heart:

If this contribution is for instructor training, please email the link to this contribution to
[email protected] so we can record your progress. You've completed your contribution
step for instructor checkout by submitting this contribution!

Keep in mind that **lesson maintainers are volunteers** and it may take them some time to
respond to your contribution. Although not all contributions can be incorporated into the lesson
materials, we appreciate your time and effort to improve the curriculum. If you have any questions
about the lesson maintenance process or would like to volunteer your time as a contribution
reviewer, please contact The Carpentries Team at [email protected].

You may delete these instructions from your comment.

\- The Carpentries
</details>
118 changes: 118 additions & 0 deletions .github/workflows/template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
name: Template
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'
steps:
- name: Set up Ruby
uses: actions/setup-ruby@main
with:
ruby-version: '2.7.1'

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

- name: Install GitHub Pages, Bundler, and kramdown gems
run: |
gem install github-pages bundler kramdown
- name: Install Python modules
run: |
if [[ $RUNNER_OS == macOS || $RUNNER_OS == Linux ]]; then
python3 -m pip install --upgrade pip setuptools wheel pyyaml==5.3.1 requests
elif [[ $RUNNER_OS == Windows ]]; then
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[@]})"
- name: Set up R
if: steps.check-rmd.outputs.count != 0
uses: r-lib/actions/setup-r@master
with:
r-version: 'release'

- name: Install needed packages
if: steps.check-rmd.outputs.count != 0
run: |
install.packages(c('remotes', 'rprojroot', 'renv', 'desc', 'rmarkdown', 'knitr'))
shell: Rscript {0}

- name: Query dependencies
if: steps.check-rmd.outputs.count != 0
working-directory: lesson
run: |
source('bin/dependencies.R')
deps <- identify_dependencies()
create_description(deps)
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows' && steps.check-rmd.outputs.count != 0
uses: actions/cache@v1
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies for R packages
if: runner.os == 'Linux' && steps.check-rmd.outputs.count != 0
working-directory: lesson
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'cat(remotes::system_requirements("ubuntu", "18.04"), sep = "\n")')
- run: make site
working-directory: lesson
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
*.pyc
*~
.DS_Store
.ipynb_checkpoints
.sass-cache
.jekyll-cache/
__pycache__
_site
.Rproj.user
.Rhistory
.RData
.bundle/
.vendor/
vendor/
.docker-vendor/
Gemfile.lock
.*history
57 changes: 57 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Travis CI is only used to check the lesson and is not involved in its deployment
dist: bionic
language: ruby
rvm:
- 2.7.1

branches:
only:
- gh-pages
- /.*/

cache:
apt: true
bundler: true
directories:
- /home/travis/.rvm/
- $R_LIBS_USER
- $HOME/.cache/pip

env:
global:
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer
- R_LIBS_USER=~/R/Library
- R_LIBS_SITE=/usr/local/lib/R/site-library:/usr/lib/R/site-library
- R_VERSION=4.0.2

before_install:
## Install R + pandoc + dependencies
- sudo add-apt-repository -y "ppa:marutter/rrutter4.0"
- sudo add-apt-repository -y "ppa:c2d4u.team/c2d4u4.0+"
- sudo add-apt-repository -y "ppa:ubuntugis/ppa"
- sudo add-apt-repository -y "ppa:cran/travis"
- travis_apt_get_update
- sudo apt-get install -y --no-install-recommends build-essential gcc g++ libblas-dev liblapack-dev libncurses5-dev libreadline-dev libjpeg-dev libpcre3-dev libpng-dev zlib1g-dev libbz2-dev liblzma-dev libicu-dev cdbs qpdf texinfo libssh2-1-dev gfortran jq python3.5 python3-pip r-base
- export PATH=${TRAVIS_HOME}/R-bin/bin:$PATH
- export LD_LIBRARY_PATH=${TRAVIS_HOME}/R-bin/lib:$LD_LIBRARY_PATH
- sudo mkdir -p /usr/local/lib/R/site-library $R_LIBS_USER
- sudo chmod 2777 /usr/local/lib/R /usr/local/lib/R/site-library $R_LIBS_USER
- echo 'options(repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/bionic/latest"))' > ~/.Rprofile.site
- export R_PROFILE=~/.Rprofile.site
- curl -fLo /tmp/texlive.tar.gz https://github.com/jimhester/ubuntu-bin/releases/download/latest/texlive.tar.gz
- tar xzf /tmp/texlive.tar.gz -C ~
- export PATH=${TRAVIS_HOME}/texlive/bin/x86_64-linux:$PATH
- tlmgr update --self
- curl -fLo /tmp/pandoc-2.2-1-amd64.deb https://github.com/jgm/pandoc/releases/download/2.2/pandoc-2.2-1-amd64.deb
- sudo dpkg -i /tmp/pandoc-2.2-1-amd64.deb
- sudo apt-get install -f
- rm /tmp/pandoc-2.2-1-amd64.deb
- Rscript -e "install.packages(setdiff(c('renv', 'rprojroot'), installed.packages()), loc = Sys.getenv('R_LIBS_USER')); update.packages(lib.loc = Sys.getenv('R_LIBS_USER'), ask = FALSE, checkBuilt = TRUE)"
- Rscript -e 'sessionInfo()'
## Install python and dependencies
- python3 -m pip install --upgrade pip setuptools wheel
- python3 -m pip install pyyaml

script:
- make lesson-check-all
- make --always-make site
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FIXME: list authors' names and email addresses.
1 change: 1 addition & 0 deletions CITATION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FIXME: describe how to cite this lesson.
11 changes: 11 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
layout: page
title: "Contributor Code of Conduct"
---
As contributors and maintainers of this project,
we pledge to follow the [Carpentry Code of Conduct][coc].

Instances of abusive, harassing, or otherwise unacceptable behavior
may be reported by following our [reporting guidelines][coc-reporting].

{% include links.md %}
Loading

0 comments on commit 9adbd18

Please sign in to comment.