Skip to content

Commit

Permalink
Merge branch 'main' into cansavvy/edits
Browse files Browse the repository at this point in the history
  • Loading branch information
avahoffman committed Mar 20, 2024
2 parents c46d95d + cd6f865 commit e5828c7
Show file tree
Hide file tree
Showing 132 changed files with 11,174 additions and 4,516 deletions.
28 changes: 20 additions & 8 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
- name: Make the branch fresh
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
git config --global user.email "[email protected]"
git config --global user.name "jhudsl-robot"
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
branch_name='preview-${{ github.event.pull_request.number }}'
echo branch doesnt exist
Expand All @@ -47,6 +47,7 @@ jobs:
toggle_url_check: "${{ env.URL_CHECKER }}"
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}"
toggle_render_preview: "${{ env.RENDER_PREVIEW }}"
toggle_make_labs: "${{ env.MAKE_LABS }}"
rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}"

########################## Make the error reports ##############################
Expand Down Expand Up @@ -84,17 +85,21 @@ jobs:
image: jhudsl/base_ottr:main

steps:
- name: Checkout files
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}

- name: Run styler
run: Rscript -e "styler::style_file(list.files(pattern = 'Rmd$', recursive = TRUE, full.names = TRUE));warnings()"

- name: Commit styled files
run: |
git config --system --add safe.directory "$GITHUB_WORKSPACE"
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add \*.Rmd
git commit -m 'Style Rmds' || echo "No changes to commit"
git push origin || echo "No changes to commit"
Expand Down Expand Up @@ -128,8 +133,8 @@ jobs:
# Set up git checkout
- name: Set up git checkout
run: |
git config --local user.email "[email protected]"
git config --local user.name "jhudsl-robot"
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
branch_name='preview-${{ github.event.pull_request.number }}'
git fetch --all
Expand Down Expand Up @@ -160,6 +165,12 @@ jobs:
# Render module details for syllabus
- name: Render module details for syllabus
run: Rscript "scripts/render_module_details_for_syllabus.R"

# Create blank labs - runs quickly, so just does it for all of them
- name: Run lab converter
if: ${{needs.yaml-check.outputs.toggle_make_labs == 'yes'}}
shell: bash
run: bash scripts/blank_labs_from_keys.sh

# Render all module files
- name: Render html of modules where .Rmd has changed
Expand Down Expand Up @@ -259,6 +270,7 @@ jobs:
outputs:
pdffiles: "${{ steps.getfiles.outputs.files }}"

########################## PDFs ##############################

render-pdf-lectures:
name: Render pdf lecture slides
Expand Down Expand Up @@ -287,8 +299,8 @@ jobs:
# Set up git checkout
- name: Set up git checkout
run: |
git config --local user.email "[email protected]"
git config --local user.name "jhudsl-robot"
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
branch_name='preview-${{ github.event.pull_request.number }}'
git fetch --all
Expand All @@ -314,7 +326,7 @@ jobs:
git add *.pdf --force
git commit -m 'Render preview' || echo "No changes to commit"
git status
git merge -s recursive --strategy-option=ours origin/${{ github.head_ref }} --allow-unrelated-histories
git pull --rebase --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours
git push --force || echo "No changes to commit"
shell: bash

23 changes: 18 additions & 5 deletions .github/workflows/render-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}

# Use the yaml-env-action action.
- name: Load environment from YAML
Expand All @@ -36,6 +39,9 @@ jobs:
make_book_txt: "${{ env.MAKE_BOOK_TXT }}"
rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}"
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}"
toggle_make_labs: "${{ env.MAKE_LABS }}"

########################## Site ##############################

render-main:
name: Render Main Site and Materials
Expand Down Expand Up @@ -85,6 +91,12 @@ jobs:
- name: Render module details for syllabus
run: Rscript "scripts/render_module_details_for_syllabus.R"

# Create blank labs - runs quickly, so just does it for all of them
- name: Run lab converter
if: ${{needs.yaml-check.outputs.toggle_make_labs == 'yes'}}
shell: bash
run: bash scripts/blank_labs_from_keys.sh

# Render all module files
- name: Render html of modules
run: |
Expand Down Expand Up @@ -127,8 +139,8 @@ jobs:
# Commit the rendered site files - html files and site_libs files
- name: Commit rendered site files
run: |
git config --local user.email "[email protected]"
git config --local user.name "jhudsl-robot"
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add . --force
git commit -m 'Render site' || echo "No changes to commit"
git pull --rebase --set-upstream origin main --allow-unrelated-histories --strategy-option=ours
Expand All @@ -138,6 +150,7 @@ jobs:
outputs:
pdffiles: "${{ steps.getfiles.outputs.files }}"

########################## PDFs ##############################

render-pdf-lectures:
name: Render pdf lecture slides
Expand Down Expand Up @@ -165,8 +178,8 @@ jobs:
# Set up git checkout
- name: Set up git checkout
run: |
git config --local user.email "[email protected]"
git config --local user.name "jhudsl-robot"
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git fetch --all
git checkout main
Expand All @@ -187,5 +200,5 @@ jobs:
git add *.pdf --force
git commit -m 'Render pdfs' || echo "No changes to commit"
git status
git merge -s recursive --strategy-option=theirs origin/main --allow-unrelated-histories
git pull --rebase --set-upstream origin main --allow-unrelated-histories --strategy-option=ours
git push --force || echo "No changes to commit"
2 changes: 1 addition & 1 deletion config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default:
holiday: "In recognition of [Martin Luther King Jr. Day](https://en.wikipedia.org/wiki/Martin_Luther_King_Jr._Day), there will be **no class on Monday January 15th, 2024**."
courseplus_web: "https://courseplus.jhu.edu/core/index.cfm/go/syl:syl.public.view/coid/20749/"
courseplus_dropboxes: "https://courseplus.jhu.edu/core/index.cfm/go/db:main/coID/20749/"
courseplus_surveys: "https://courseplus.jhu.edu/core/index.cfm/go/survey2:admin.home/coID/20749/#!/"
google_survey: "https://forms.gle/rTqJ4qwV2boo3FL78"
slack_workspace: "https://intro-to-r-140-604.slack.com/"
ta: "Padmashri Saravanan (psarava1 at jhu.edu), Alex Newman (anewma28 at jhu.edu)"
instructors: "[Carrie Wright](https://carriewright11.github.io/) (cwrigh60 at jhu.edu), [Ava Hoffman](https://www.avahoffman.com/) (ava.hoffman at jhu.edu), [Clifton McKee](https://clifmckee.github.io/) (cmckee7 at jhu.edu)"
Expand Down
4 changes: 4 additions & 0 deletions config_automation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@ style-code: no
# Test build the docker image if any docker-relevant files have been changed
docker-test: no


# Autogenerate Labs from Keys (clear the Rmarkdown chunks)
make-labs: yes

# What docker image should be used for rendering?
rendering-docker-image: 'jhudsl/intro_to_r:1.1.1'
Loading

0 comments on commit e5828c7

Please sign in to comment.