From 19ce025d350ef89c3dea92832945bdbb506d5b69 Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Tue, 4 Oct 2022 12:58:24 -0400 Subject: [PATCH] Add pull-request.yml to use report-maker.yml here (#513) * Update Staging branch with what's in main (#438) * Return to pre-gist method of spell check (#409) * Return to pre-gist method of spell check * Get rid of gist stuff on delete-preview too * Temporarily add spelling errors to test * Commit before testing * Switch to use -z * Fix git diff step * Just look at the local main since it should be up to date * make it simple * Get rid of double bracket * No brackets? * Revert "Temporarily add spelling errors to test" This reverts commit 9e9a9325527142c377bb27a1dfeb040f0859f0dd. * Update screenshot for new repo (#410) * Update template button screenshot (#411) * Update screenshot for new repo * Update template button too * See if `fetch-depth: 0` fixes the shallow problem (#412) * Update screenshot for new repo * Update template button too * fetch it all * Switch to devtools::session_info() * Render bookdown * Update screenshot for git-secret.png (#414) * Update screenshot for git-secret.png * Crop off irrelevant git secrets * syntax updates * Needed a semicolon * Fix branch handling * Update spell check set up * Update main * add brackets * set shell intentionally * fix if statements * Create PR if it can't push directly * Make sure it merges * Alter branch test * quote the 0? * switch to -z * Delete extra then * This should work * Change to preview- again whoops * Add a push step * Update starting course * set upstream * Set to bash intentionally (#419) * set to bash * Update * no workflow dispatch * Test leanpub from here (#420) * Test leanpub from here * Update comments * Add check quizzes too * Couple edits * Shut them off for now * Update comments * Render leanpub * Minor polishing of steps (#421) * Test leanpub from here * Update comments * Add check quizzes too * Couple edits * Shut them off for now * Update comments * Note which places needed to be uncommented * Just making the step clearer * Add a git fetch * Add quizzes to spell check * Update README.md * Render leanpub * Add new repository to sync * Polish Examples in Rmds (#426) * Echo false in examples * Updating wiki * Render bookdown * Render bookdown (#427) * Prep for ottr rename (#428) * Render bookdown * Make docker unfail (#431) * Make docker not fail * Add Dockerfile example * Get rid of extra line * Skip build for this test * comment out push part too for this test * undo test Dockerfile * Render bookdown * Try out screenshot creator as a part of the new Leanpub set up (#422) * Try out screenshot creator * Fix spacing * Get rid of typo * fix argument spec * Fix git pat handling * Add copy over assets step * Try this * Try installing just the packages we need * Add install of remotes * Try using devtools instead * try set environ * Try to install R first * Add prereqs * Try rocker r-base * Put installations in script * Try different strategy * Switch to tidyverse * Make directory in bash * I guess I'm making this its own docker image * This isn't working but I want it in case I come back to it * Switch to wkhtmltopdf * Lets' try it * Trying leanbuild steps on their own dockerfile * Test build of leanbuild docker image * Try out webshot r package * fix file path to script * Oh. Actually fix it * Try installing webshot::install_phantomjs * Try installing phantomjs on its own first * Set this up * Build from jhudsl/course_template * Switch back to main dockerfile * assets problem * It works! * Revert "assets problem" This reverts commit 2aada9bf3dd814494547e84b9aa65344710457aa. * Add markdown maker basics * Push this version before I delete things * Clean up * Delete the pdfs * Reconfig with latest ottr package changes * Turn on render again * Add PR instead * Move copying step * Add an :: that was missing * Fix arguments for getting pages url * misplaced quotes * Add make_book_txt = TRUE * It's working! Undo the commenting part * Set base to main * Revert "It's working! Undo the commenting part" This reverts commit 92e5081bcad0a9c32b0390cf15db974cfbec5cd5. * rm manuscript folder * Just commit to main * Delete old manuscript files * Copy over assets * Render bookdown * Remove manuscript if it is there * Set group and user id to get rid of permissions probs * Forgot \ 's * Render bookdown * Make it force push * only force manuscript dir * Render Leanpub * Render Leanpub * Render Leanpub * Add to transfer PRs * Delete manuscript folder * Add to sync.yml * Render Leanpub * Remove _Template bit * Add coursera bit and _Quizzes * Clean out manuscript folder when starting new course * Make transfers go to the right folder * add / * Update sync.yml with OTTR_Template_Website (#437) Co-authored-by: jhudsl-robot Co-authored-by: GitHub Actions Co-authored-by: jhudsl-robot <97678365+jhudsl-robot@users.noreply.github.com> Co-authored-by: Tiffany Miller Co-authored-by: jhudsl-robot * Delete packages.bib * Minor edits to index.Rmd * Delete extraneous files * Consolidate and config a pull request GHA (#448) * Create config_automation.yml * Update style-and-sp-check.yml * Update the filename :expressionless: * Checking dependency * Update style-and-sp-check.yml * Testing that file is carried over * Add toggle to second check * Change config to test * Test removal of some extra text * Change config to test (again) * Update config_automation.yml * What does the output look like with more checks added? * Fix spacing * Forgot "steps:" * BIG YAML * Get rid of other ones * Fix names * Add needs * Try adding docker to it * Fix syntax * Gotta check it out first * Extra "if" lying around * Set logically differently * Testing change * Add Ava's suggestions! Co-authored-by: AM Hoffman * Consolidate and config a rendering GHA (#449) * Create config_automation.yml * Update style-and-sp-check.yml * Update the filename :expressionless: * Checking dependency * Update style-and-sp-check.yml * Testing that file is carried over * Add toggle to second check * Change config to test * Test removal of some extra text * Change config to test (again) * Update config_automation.yml * What does the output look like with more checks added? * Fix spacing * Forgot "steps:" * BIG YAML * Get rid of other ones * Fix names * Add needs * Try adding docker to it * Make a render-all yaml * Fix syntax * Gotta check it out first * Extra "if" lying around * Set logically differently * Echo no branch to delete if there is none to delete * Update sync.yml * fix syntax * Fix name of render-all * Add names Co-authored-by: AM Hoffman * Update pull-request.yml to use report-maker.yml * Need to add + 1 because the column names don't count * Turn on quiz check for testing * Add comment * Try out different syntax for + 1 * Add errors to test * Add a quiz error * Add url error * Make quiz error * Add question error * Add URL * Switch version of url-checker * Add url-checker to docker image * Add url-check.R adds! * Update report-maker.yml * fix script * Get rid of fake errors * Revert "Add question error" This reverts commit dc411cb83989ab8b252c9909c553c2ea3207bd0a. * Fix quiz * Add a correct answer * Stop checking quizzes * Try out new github action * Fix indents * Try this out? * Fix comments * git force --add * Updates * Get rid of secrets: * Try ottr-reports set up * Get rid of secrets. * Test secrets.GH_PAT * Ignore checks for testing purposes * Try secrets.GH_PAT again * Try supplying secret through environment * Switch order of steps * Try somewhere else * use ls- R again * Try again * Re-run without script directory perl thing * Try $GITHUB_WORKSPACE * Maybe we need to check out files in report_maker * Use basename * Try to fix syntax * Name output variable in earlier step * Declare report name * Add error URL * Fix error url * Drop quotes and {} * echo it maybe * add more explicit variable declaration * Drop brackets * no quotes * Try to fix quotes * Try quotes * Try `contains()` * Commit reports to the branch * Try to supply token * add secrets designation * Use V3 checkout * switch gh_pat designation * login as jhudsl-robot * Move the steps: * No login * Specify GH_PAT * Try this instead * Try environment thing * Revert "Try environment thing" This reverts commit ac469b8b570ae4499b8549f1bd28be9cfb35094e. * Don't set inputs.gh_pat * set git config * Try to fix error 11 * Fix an inputs.gh_pat * specify ref * Adjust the logic * git add adjust * Add errors to check that this is working * Try again * Calculate error number by hand * Declare number of errors * Try this instead * Forgot a $ * Try to fix number thing * Still trying to fix error count * print out error numbers * Add spelling errors * Try to set up the error_num another way * Print out error numbers * Remove errors and see if this works * Fix branch merge option Co-authored-by: GitHub Actions Co-authored-by: jhudsl-robot <97678365+jhudsl-robot@users.noreply.github.com> Co-authored-by: Tiffany Miller Co-authored-by: jhudsl-robot Co-authored-by: AM Hoffman --- .github/workflows/pull_request.yml | 286 +++-------------------------- .github/workflows/render-all.yml | 5 +- .github/workflows/report-maker.yml | 126 +++++++++++++ quizzes/quiz_ch1.md | 1 + resources/Dockerfile | 19 ++ 5 files changed, 180 insertions(+), 257 deletions(-) create mode 100644 .github/workflows/report-maker.yml create mode 100644 resources/Dockerfile diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index d694b63c..e21d8a76 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,4 +1,4 @@ -# Candace Savonen Dec 2021 +# Candace Savonen Aug 2022 name: Pull Request @@ -57,92 +57,38 @@ jobs: rendering_docker_image: "${{ env.RENDERING_DOCKER_IMAGE }}" dockerfiles_changed: steps.verify-changed-files.outputs.files_changed +########################## Make the error reports ############################## spell-check: name: Check spelling needs: yaml-check - runs-on: ubuntu-latest if: ${{needs.yaml-check.outputs.toggle_spell_check == 'yes'}} - container: - image: jhudsl/course_template:main - - 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 }}' - git fetch --all - git checkout $branch_name - git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }} --allow-unrelated-histories - shell: bash - - - name: Run spell check - id: spell_check_run - run: | - results=$(Rscript "scripts/spell-check.R") - echo "::set-output name=sp_chk_results::$results" - - - name: Commit spell check errors - run: | - branch_name='preview-${{ github.event.pull_request.number }}' - git add --force check_reports/spell_check_results.tsv || echo "No changes to commit" - git commit -m 'Add spell check file' || echo "No changes to commit" - git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours - git push --force origin $branch_name || echo "No changes to commit" - - - name: Build components of the spell check comment - id: build-components - env: - GH_PAT: ${{ secrets.GH_PAT }} - run: | - branch_name='preview-${{ github.event.pull_request.number }}' - sp_error_url=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/$branch_name/check_reports/spell_check_results.tsv - echo ::set-output name=time::$(date +'%Y-%m-%d') - echo ::set-output name=commit_id::$GITHUB_SHA - echo ::set-output name=sp_error_url::$sp_error_url + uses: ./.github/workflows/report-maker.yml + with: + check_type: spelling + error_min: 3 + gh_pat: secrets.GH_PAT - # Handle the commenting - - name: Find Comment - uses: peter-evans/find-comment@v1 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: spelling errors - - - name: Spelling errors! - if: ${{ steps.spell_check_run.outputs.sp_chk_results >= 3 }} - uses: peter-evans/create-or-update-comment@v1 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - :warning: There are spelling errors that need to be addressed. [Read this guide for more info](https://github.com/jhudsl/OTTR_Template/wiki/Spell-check). - [Download the errors here.](${{ steps.build-components.outputs.sp_error_url }}) - _Comment updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ - edit-mode: replace - - - name: Check spell check results - fail if too many errors - if: ${{ steps.spell_check_run.outputs.sp_chk_results >= 3 }} - run: exit 1 - - - name: No spelling errors - if: ${{ steps.spell_check_run.outputs.sp_chk_results < 3 }} - uses: peter-evans/create-or-update-comment@v1 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - No spelling errors! :tada: - _Comment updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ - edit-mode: replace + url-check: + name: Check URLs + needs: yaml-check + if: ${{needs.yaml-check.outputs.toggle_url_check == 'yes'}} + uses: ./.github/workflows/report-maker.yml + with: + check_type: urls + error_min: 0 + gh_pat: secrets.GH_PAT + + quiz-check: + name: Check quiz formatting + if: ${{needs.yaml-check.outputs.toggle_quiz_check == 'yes'}} + needs: yaml-check + uses: ./.github/workflows/report-maker.yml + with: + check_type: quiz_format + error_min: 0 + gh_pat: secrets.GH_PAT +############################# Style the code ################################### style-code: name: Style code needs: yaml-check @@ -166,181 +112,7 @@ jobs: git commit -m 'Style Rmds' || echo "No changes to commit" git push origin || echo "No changes to commit" - url-check: - name: Check URLs - needs: yaml-check - runs-on: ubuntu-latest - if: ${{needs.yaml-check.outputs.toggle_url_check == 'yes'}} - container: - image: jhudsl/course_template:main - - steps: - - name: checkout repo - uses: actions/checkout@v2 - - - 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 }}' - git fetch --all - git checkout $branch_name - git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }} --allow-unrelated-histories - shell: bash - - - name: URLs checker - id: url_errors - run: | - chk_results=$(Rscript scripts/url-check.R) - echo $chk_results - - echo "::set-output name=url_results::$chk_results" - - - name: Commit URL check - run: | - branch_name='preview-${{ github.event.pull_request.number }}' - git add --force check_reports/url_checks.tsv || echo "No changes to commit" - git commit -m 'Add URL check file' || echo "No changes to commit" - git fetch - git merge -s recursive --strategy-option=ours origin/${{ github.head_ref }} --allow-unrelated-histories - git push --force origin $branch_name || echo "No changes to commit" - - - name: Build components of the spell check comment - id: build-components - env: - GH_PAT: ${{ secrets.GH_PAT }} - run: | - branch_name='preview-${{ github.event.pull_request.number }}' - url_errors=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/$branch_name/check_reports/url_checks.tsv - echo ::set-output name=time::$(date +'%Y-%m-%d') - echo ::set-output name=commit_id::$GITHUB_SHA - echo ::set-output name=url_errors::$url_errors - - # Handle the commenting - - name: Find Comment - uses: peter-evans/find-comment@v1 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: broken URLs - - - name: URL errors! - if: ${{ steps.url_errors.outputs.url_results > 0 }} - uses: peter-evans/create-or-update-comment@v1 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - :warning: There are broken URLs that need to be addressed. [Read this guide for more info](https://github.com/jhudsl/OTTR_Template/wiki/How-to-set-up-and-customize-GitHub-actions-robots#check-for-broken-urls). - [Download the errors here.](${{ steps.build-components.outputs.url_errors }}) - _Comment updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ - edit-mode: replace - - - name: Check URL results - fail if too many errors - if: ${{ steps.url_errors.outputs.url_results > 0 }} - run: exit 1 - - - name: No URL errors - if: ${{ steps.url_errors.outputs.url_results == 0 }} - uses: peter-evans/create-or-update-comment@v1 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - No broken URLs detected! :tada: - _Comment updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ - edit-mode: replace - - check-quizzes: - name: Check Leanpub quizzes - needs: yaml-check - runs-on: ubuntu-latest - container: - image: jhudsl/course_template:main - 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 }}' - git fetch --all - git checkout $branch_name - git merge -s recursive --strategy-option=theirs origin/${{ github.head_ref }} --allow-unrelated-histories - shell: bash - - - name: Run quiz check - id: quiz_check_run - run: | - Rscript -e "ottrpal::check_quizzes(quiz_dir = 'quizzes', write_report = TRUE, verbose = TRUE)" - results=0 - if [ -f question_error_report.tsv ]; then - results=$(wc -l < question_error_report.tsv >/dev/null) - fi - echo ::set-output name=quiz_chk_results::$results - - - name: Commit quiz check errors - run: | - branch_name='preview-${{ github.event.pull_request.number }}' - git add --force question_error_report.tsv || echo "No changes to commit" - git commit -m 'Add question error report file' || echo "No changes to commit" - git pull --set-upstream origin $branch_name --allow-unrelated-histories --strategy-option=ours - git push origin $branch_name || echo "No changes to commit" - - - name: Build components of the quiz check comment - id: build-components - env: - GH_PAT: ${{ secrets.GH_PAT }} - run: | - branch_name='preview-${{ github.event.pull_request.number }}' - quiz_error_url=https://raw.githubusercontent.com/${GITHUB_REPOSITORY}/$branch_name/question_error_report.tsv - echo ::set-output name=time::$(date +'%Y-%m-%d') - echo ::set-output name=commit_id::$GITHUB_SHA - echo ::set-output name=quiz_error_url::$quiz_error_url - - # Handle the commenting - - name: Find Comment - uses: peter-evans/find-comment@v1 - id: fc - with: - issue-number: ${{ github.event.pull_request.number }} - comment-author: 'github-actions[bot]' - body-includes: quiz errors - - - name: Quiz errors! - if: ${{ steps.quiz_check_run.outputs.quiz_chk_results >= 2 }} - uses: peter-evans/create-or-update-comment@v1 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - :warning: There are quiz errors that need to be addressed. [Read this guide for more info](https://github.com/jhudsl/OTTR_Template/wiki/Publishing-on-Leanpub#setting-up-quizzes). - [Download the errors here.](${{ steps.build-components.outputs.quiz_error_url }}) - _Comment updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ - edit-mode: replace - - - name: Check quiz check results - fail if too many errors - if: ${{ steps.quiz_check_run.outputs.quiz_chk_results >= 2 }} - run: exit 1 - - - name: No quiz errors - if: ${{ steps.quiz_check_run.outputs.quiz_chk_results < 2 }} - uses: peter-evans/create-or-update-comment@v1 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{ github.event.pull_request.number }} - body: | - No quiz errors detected! :tada: - _Comment updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ - edit-mode: replace +############################# Render Preview ################################### render-preview: name: Render preview @@ -451,6 +223,8 @@ jobs: _Updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ edit-mode: replace +############################## Build Docker #################################### + build-docker: name: Build Docker image needs: yaml-check diff --git a/.github/workflows/render-all.yml b/.github/workflows/render-all.yml index d76dd945..407e1caf 100644 --- a/.github/workflows/render-all.yml +++ b/.github/workflows/render-all.yml @@ -181,6 +181,7 @@ jobs: git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} git add --force manuscript/* git add --force resources/* + git add --force docs/* git commit -m 'Render Leanpub' || echo "No changes to commit" git pull --allow-unrelated-histories --strategy-option=ours git push origin main || echo "No changes to push" @@ -217,7 +218,9 @@ jobs: GH_PAT: ${{ secrets.GH_PAT }} run: | git remote set-url origin https://${GH_PAT}@github.com/${GITHUB_REPOSITORY} - git add --force . + git add --force manuscript/* + git add --force resources/* + git add --force docs/* git commit -m 'Render Coursera quizzes' || echo "No changes to commit" git pull --allow-unrelated-histories --strategy-option=ours git push origin main || echo "No changes to push" diff --git a/.github/workflows/report-maker.yml b/.github/workflows/report-maker.yml new file mode 100644 index 00000000..074a5eb9 --- /dev/null +++ b/.github/workflows/report-maker.yml @@ -0,0 +1,126 @@ +# Candace Savonen March 2022 + +# This calls the report makers but then also handles the commenting + +name: Run error checker + +on: + workflow_call: + inputs: + check_type: + required: true + type: string + error_min: + default: 0 + type: number + gh_pat: + type: string + required: true + +jobs: + error-check: + runs-on: ubuntu-latest + container: + image: jhudsl/course_template:main + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + ref: 'preview-${{ github.event.pull_request.number }}' + + - name: Run the check + uses: jhudsl/ottr-reports@main + id: check_results + with: + check_type: ${{ inputs.check_type }} + error_min: ${{ inputs.error_min }} + + - name: Declare report name + id: setup + run: | + echo ::set-output name=report_name::$(basename ${{ steps.check_results.outputs.report_path }}) + + if ${{ contains(inputs.check_type, 'spelling') }} ;then + echo ::set-output name=error_name::'spelling errors' + elif ${{ contains(inputs.check_type, 'urls') }} ;then + echo ::set-output name=error_name::'broken urls' + elif ${{ contains(inputs.check_type, 'quiz_format') }} ;then + echo ::set-output name=error_name::'quiz formatting errors' + fi + +############################# Handle commenting ################################ + + - name: Build components of the spell check comment + id: build-components + run: | + branch_name='preview-${{ github.event.pull_request.number }}' + echo ::set-output name=time::$(date +'%Y-%m-%d') + echo ::set-output name=commit_id::$GITHUB_SHA + echo ::set-output name=error_url::https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$branch_name/${{ steps.check_results.outputs.report_path }} + shell: bash + + - name: Commit check files to branch + id: commit + run: | + branch_name='preview-${{ github.event.pull_request.number }}' + + git config --local user.email "itcrtrainingnetwork@gmail.com" + git config --local user.name "jhudsl-robot" + + git add --force . || echo "No changes to commit" + git commit -m 'Add check file' || echo "No changes to commit" + git fetch + git merge -s recursive --strategy-option=ours origin/${{ github.head_ref }} --allow-unrelated-histories + git push --force origin $branch_name || echo "No changes to commit" + + error_num=$(cat ${{ steps.check_results.outputs.report_path }} | wc -l) + error_num="$((error_num-1))" + echo ::set-output name=error_num::$error_num + shell: bash + + - name: Find Comment + uses: peter-evans/find-comment@v1 + id: fc + with: + issue-number: ${{ github.event.pull_request.number }} + comment-author: 'github-actions[bot]' + body-includes: ${{ steps.setup.outputs.error_name }} + + - name: There are errors! + if: ${{ steps.commit.outputs.error_num > inputs.error_min }} + uses: peter-evans/create-or-update-comment@v1 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + :warning: ${{ steps.setup.outputs.error_name }} :warning: + There are ${{ steps.setup.outputs.error_name }} that need to be addressed. [Read this guide for more info](https://github.com/jhudsl/OTTR_Template/wiki/Most-common-errors-and-pitfalls). + [Download the errors here.](${{ steps.build-components.outputs.error_url }}) + _Comment updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ + edit-mode: replace + + - name: Fail if too many errors + if: ${{ steps.commit.outputs.error_num > inputs.error_min }} + run: | + echo ${{ steps.commit.outputs.error_num }} + exit 1 + shell: bash + + - name: Don't fail if not too many errors + if: ${{ steps.commit.outputs.error_num <= inputs.error_min }} + run: | + echo ${{ steps.commit.outputs.error_num }} + shell: bash + + - name: No errors + if: ${{ steps.commit.outputs.error_num <= inputs.error_min }} + uses: peter-evans/create-or-update-comment@v1 + with: + comment-id: ${{ steps.fc.outputs.comment-id }} + issue-number: ${{ github.event.pull_request.number }} + body: | + No ${{ steps.setup.outputs.error_name }}! :tada: + _Comment updated at ${{ steps.build-components.outputs.time }} with changes from ${{ steps.build-components.outputs.commit_id }}_ + edit-mode: replace diff --git a/quizzes/quiz_ch1.md b/quizzes/quiz_ch1.md index 7976d75f..c0305c2d 100644 --- a/quizzes/quiz_ch1.md +++ b/quizzes/quiz_ch1.md @@ -28,6 +28,7 @@ o) A second optional incorrect answer here {choose-answers: 4} ? Second question to ask goes here? +C) A correct answer here! m) Mandatory incorrect answers have an "m" m) A second mandatory incorrect answer o) An optional incorrect answer here marked with an "o" diff --git a/resources/Dockerfile b/resources/Dockerfile new file mode 100644 index 00000000..46fc78d0 --- /dev/null +++ b/resources/Dockerfile @@ -0,0 +1,19 @@ +FROM jhudsl/course_template +LABEL maintainer="your_email.com" + +#################### EXAMPLES OF INSTALLING PACKAGES ########################### +# Install a Linux/Ubuntu package +# RUN apt-get update && apt-get install -y --no-install-recommends \ +# package_name + +# Install a package from CRAN +# RUN Rscript -e "install.packages( \ +# c('package_name'))" + +# Install a package from Bioconductor +# RUN Rscript -e "options(warn = 2); BiocManager::install( \ +# c('package_name') + +# Add a python package +# RUN RUN pip3 install \ +# "somepackage==0.1.0"