Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor polishing of steps #421

Merged
merged 11 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/check-quizzes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ name: Check Leanpub Quizzes

on:
workflow_dispatch:
### UNCOMMENT THIS SECTION IF YOU WISH PREPARE YOUR COURSE QUIZZES FOR LEANPUB AUTOMATICALLY
# pull_request:
# branches: [ main, staging]
# paths:
# - 'quizzes/*'
######### END OF SECTION #########

jobs:
check-quizzes:
Expand All @@ -35,6 +37,7 @@ jobs:
git push --set-upstream origin $branch_name
else
echo branch does exist
git fetch --all
git checkout $branch_name
git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }}
fi
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/render-leanpub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ name: Render and publish Leanpub

on:
workflow_dispatch:
### UNCOMMENT THIS SECTION IF YOU WISH PREPARE YOUR COURSE FOR LEANPUB AUTOMATICALLY
# pull_request:
# branches: [ main ]
# types: [closed]
Expand All @@ -13,6 +14,7 @@ on:
# - docker/*
# - assets/*
# - quizzes/*
######### END OF SECTION #########

jobs:
# This workflow contains a single job called "build-all"
Expand All @@ -33,9 +35,11 @@ jobs:

# Run leanpub rendering
- name: Run leanbuild::bookdown_to_leanpub
run: |
Rscript -e "leanbuild::bookdown_to_leanpub(make_book_txt = TRUE);
leanbuild::render_coursera(convert_quizzes = TRUE)"
run: Rscript -e "leanbuild::bookdown_to_leanpub(make_book_txt = TRUE)"

# Convert quizzes to Coursera format
- name: Convert quizzes to coursera
run: Rscript -e "leanbuild::render_coursera(convert_quizzes = TRUE)"

# Commit the rendered leanpub files
- name: Commit rendered leanpub files
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/render-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ jobs:
git push --set-upstream origin $branch_name
else
echo branch does exist
git fetch --all
git checkout $branch_name
git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }}
fi
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/style-and-sp-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
git push --set-upstream origin $branch_name
else
echo branch does exist
git fetch --all
git checkout $branch_name
git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }}
fi
Expand Down
7 changes: 7 additions & 0 deletions scripts/spell-check.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ dictionary <- c(dictionary, spelling::spell_check_text("⬇️")$word)

# Only declare `.Rmd` files but not the ones in the style-sets directory
files <- list.files(pattern = 'Rmd$', recursive = TRUE, full.names = TRUE)

# Get quiz file names
quiz_files <- list.files(file.path(root_dir, "quizzes"), pattern = '\\.md$', full.names = TRUE)

# Put into one list
files <- c(files, quiz_files)

files <- grep("About.Rmd", files, ignore.case = TRUE, invert = TRUE, value = TRUE)
files <- grep("style-sets", files, ignore.case = TRUE, invert = TRUE, value = TRUE)

Expand Down