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

Add screenshots for updating the wiki #461

Closed
wants to merge 5 commits into from
Closed
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
150 changes: 38 additions & 112 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ jobs:
name: Load user automation choices
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout files
uses: actions/checkout@v2
with:
fetch-depth: 0

# Use the yaml-env-action action.
- name: Load environment from YAML
Expand All @@ -29,28 +31,6 @@ jobs:
docker/Dockerfile
docker/github_package_list.tsv

outputs:
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}"
toggle_spell_check: "${{ env.STYLE_AND_SP_CHECK }}"
toggle_url_check: "${{ env.URL_CHECKER }}"
toggle_render_preview: "${{ env.RENDER_PREVIEW }}"
toggle_docker_build: "${{ env.DOCKER_BUILD }}"
dockerfiles_changed: steps.verify-changed-files.outputs.files_changed

style-n-check:
name: Check style and spelling
needs: yaml-check
runs-on: ubuntu-latest
if: ${{needs.yaml-check.outputs.toggle_spell_check == 'yes'}}
container:
image: jhudsl/course_template

steps:
- name: Checkout files
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Configure git
run: |
git config --local user.email "itcrtrainingnetwork@gmail.com"
Expand All @@ -70,6 +50,23 @@ jobs:
fi
shell: bash

outputs:
toggle_quiz_check: "${{ env.CHECK_QUIZZES }}"
toggle_spell_check: "${{ env.STYLE_AND_SP_CHECK }}"
toggle_url_check: "${{ env.URL_CHECKER }}"
toggle_render_preview: "${{ env.RENDER_PREVIEW }}"
toggle_docker_build: "${{ env.DOCKER_BUILD }}"
dockerfiles_changed: steps.verify-changed-files.outputs.files_changed

style-n-check:
name: Check style and spelling
needs: yaml-check
runs-on: ubuntu-latest
if: ${{needs.yaml-check.outputs.toggle_spell_check == 'yes'}}
container:
image: jhudsl/course_template

steps:
- name: Run spell check
id: spell_check_run
run: |
Expand All @@ -85,6 +82,9 @@ jobs:

- name: Commit spell check errors
run: |
git config --local user.email "itcrtrainingnetwork@gmail.com"
git config --local user.name "jhudsl-robot"

branch_name='preview-${{ github.event.pull_request.number }}'
git add --force resources/spell_check_results.tsv
git commit -m 'Add spell check file' || echo "No changes to commit"
Expand Down Expand Up @@ -155,14 +155,6 @@ jobs:
if: ${{needs.yaml-check.outputs.toggle_url_check == 'yes'}}

steps:
- name: checkout repo
uses: actions/checkout@v2

- name: Login as jhudsl-robot
run: |
git config --local user.email "itcrtrainingnetwork@gmail.com"
git config --local user.name "jhudsl-robot"

- name: URLs-checker
uses: urlstechie/urlchecker-action@master
with:
Expand All @@ -189,30 +181,6 @@ jobs:
image: jhudsl/course_template
if: ${{needs.yaml-check.outputs.toggle_quiz_check == 'yes'}}
steps:
- name: Checkout files
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Configure git
run: |
git config --local user.email "itcrtrainingnetwork@gmail.com"
git config --local user.name "jhudsl-robot"

branch_name='preview-${{ github.event.pull_request.number }}'
exists=$(git ls-remote https://${{ secrets.GH_PAT }}@github.com/$GITHUB_REPOSITORY $branch_name | wc -l | xargs)
if [[ $exists == 0 ]];then
echo branch doesnt exist
git checkout -b $branch_name
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
shell: bash

- name: Run quiz check
id: quiz_check_run
run: |
Expand All @@ -226,18 +194,10 @@ jobs:
- name: Commit quiz check errors
run: |
branch_name='preview-${{ github.event.pull_request.number }}'
git diff --name-only origin/main -- question_error_report.tsv >/dev/null && changes=true || changes=false
echo $changes
if $changes == true; then
git diff --name-only origin/$branch_name question_error_report.tsv >/dev/null && changes=true || changes=false
echo $changes
if $changes == true; then
git add --force question_error_report.tsv
git diff-index --quiet HEAD || git commit -m 'Add question error report file'
git pull --set-upstream origin $branch_name --allow-unrelated-histories
git push origin $branch_name
fi
fi
git add --force question_error_report.tsv
git commit -m 'Add question error report file' || echo "No changes to commit"
git pull --set-upstream origin $branch_name --allow-unrelated-histories
git push origin $branch_name || echo "No changes to commit"

- name: Build components of the quiz check comment
id: build-components
Expand Down Expand Up @@ -294,40 +254,15 @@ jobs:
image: jhudsl/course_template
if: ${{needs.yaml-check.outputs.toggle_render_preview == 'yes'}}
steps:
- name: Checkout files
uses: actions/checkout@v2
with:
fetch-depth: 0

# Set up git checkout
- name: Set up git checkout
run: |
git config --local user.email "itcrtrainingnetwork@gmail.com"
git config --local user.name "jhudsl-robot"

branch_name='preview-${{ github.event.pull_request.number }}'
exists=$(git ls-remote https://${{ secrets.GH_PAT }}@github.com/$GITHUB_REPOSITORY $branch_name | wc -l | xargs)
if [[ $exists == 0 ]];then
echo branch doesnt exist
git checkout -b $branch_name
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

rm -r docs/*
shell: bash

# Run bookdown rendering
- name: Run bookdown render
id: bookdown
run: Rscript -e "bookdown::render_book('index.Rmd', output_format = 'all')"
run: |
rm -r docs/*
Rscript -e "bookdown::render_book('index.Rmd', output_format = 'all')"

# Run TOC-less version
# Rendered content for Leanpub and Coursera is very similar.
# Rendered content for Leanpub and Coursera is very similar.
# This job creates a shared scaffold for both.
- name: Run TOC-less version of render
id: tocless
Expand All @@ -346,9 +281,13 @@ jobs:
- name: Commit rendered bookdown files to preview branch
id: commit
run: |
git config --local user.email "itcrtrainingnetwork@gmail.com"
git config --local user.name "jhudsl-robot"

branch_name='preview-${{ github.event.pull_request.number }}'
git diff origin/main -- docs >/dev/null && changes=true || changes=false
echo ::set-output name=changes::$changes

git add . --force
git commit -m 'Render preview' || echo "No changes to commit"
git pull --set-upstream origin $branch_name --allow-unrelated-histories
Expand Down Expand Up @@ -411,22 +350,6 @@ jobs:
if: ${{needs.yaml-check.outputs.toggle_docker_build == 'yes' && needs.yaml-check.outputs.dockerfiles_changed == 'true' && github.head_ref != 'repo-sync/OTTR_Template/default'}}

steps:
- name: checkout repo
uses: actions/checkout@v2

- name: Verify Dockerfiles changed?
uses: tj-actions/verify-changed-files@v8.8
id: verify-changed-files
with:
files: |
docker/Dockerfile
docker/github_package_list.tsv

- name: Login as jhudsl-robot
run: |
git config --local user.email "itcrtrainingnetwork@gmail.com"
git config --local user.name "jhudsl-robot"

# Set up Docker build
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
Expand Down Expand Up @@ -454,3 +377,6 @@ jobs:
context: docker
file: docker/Dockerfile
tags: jhudsl/course_template

- name: Get token
run: rm -f docker/git_token.txt
Binary file added resources/screenshots/check-comments.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/gha-checks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.