-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from jhudsl/cansavvy/testing
Testing if ottr-reports work
- Loading branch information
Showing
11 changed files
with
347 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,44 @@ | ||
# Candace Savonen Mar 2022 | ||
|
||
name: Testing ottr-reports | ||
on: [pull_request] | ||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
run: | ||
|
||
spell-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Actions Repository | ||
uses: actions/checkout@v2 | ||
|
||
|
||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Check spelling | ||
uses: ./ | ||
with: | ||
check_type: "spelling" | ||
check_type: spelling | ||
error_min: 3 | ||
|
||
urls-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Actions Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Check URLs | ||
uses: ./ | ||
with: | ||
check_type: "urls" | ||
check_type: urls | ||
error_min: 0 | ||
|
||
quiz-format: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Actions Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Check quiz formatting | ||
uses: ./ | ||
with: | ||
check_type: "quiz_format" | ||
check_type: quiz_format | ||
error_min: 0 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,31 @@ | ||
# Container image that runs your code | ||
FROM jhudsl/course_template:main | ||
COPY entrypoint.sh /entrypoint.sh | ||
FROM rocker/r-base | ||
LABEL maintainer="cansav09@gmail.com" | ||
|
||
# Install apt-getable packages to start | ||
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils dialog | ||
RUN apt-get install -y --no-install-recommends \ | ||
libxt6 \ | ||
libpoppler-cpp-dev \ | ||
vim \ | ||
libglpk40 \ | ||
curl \ | ||
libxml2-dev \ | ||
libcurl4-openssl-dev \ | ||
libssl-dev | ||
|
||
# Needed R packages | ||
RUN Rscript -e "options(warn = 2);install.packages( \ | ||
c('tidyverse', \ | ||
'rprojroot', \ | ||
'spelling', \ | ||
'ottrpal', \ | ||
'optparse'), \ | ||
repos = 'https://cloud.r-project.org/')" | ||
|
||
COPY scripts/* ./scripts/ | ||
WORKDIR /github/workspace | ||
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] | ||
|
||
ARG CHECK_TYPE | ||
ENV CHECK_TYPE=${INPUT_CHECK_TYPE} | ||
|
||
ENTRYPOINT ["echo", "$CHECK_TYPE", ">>", "check_type.txt", ";", "Rscript", "scripts/check_type.R"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: 'ottr-reports' | ||
author: "Candace Savonen" | ||
description: "Run OTTR checks for spelling, urls, and quiz formats" | ||
|
||
inputs: | ||
check_type: | ||
description: "There are three types of reports that can be done and specified: 'spelling', 'urls', or 'quiz_format'." | ||
required: true | ||
type: string | ||
error_min: | ||
description: "What number of errors should make this check fail?" | ||
default: 0 | ||
type: number | ||
|
||
runs: | ||
using: 'docker' | ||
image: 'jhudsl/ottr-reports' | ||
args: | ||
- ${{ inputs.check_type }} | ||
- ${{ inputs.error_min }} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
|
||
{quiz, id: quiz_name_here, attempts: 10} | ||
|
||
## Template quiz | ||
|
||
Put any other instructions your quiz takers need to know here like: Choose the best answer. | ||
|
||
{choose-answers: 4} | ||
? First question to ask goes here. (Note- you need a question mark at end like this. Just one is required if using a question mark in your question field)? | ||
|
||
C) One correct answer here marked with a "C" | ||
C) A second 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" | ||
o) A second optional incorrect answer here | ||
|
||
{choose-answers: 4} | ||
? Question example with just a question mark? | ||
|
||
C) One correct answer here marked with a "C" | ||
C) A second 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" | ||
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" | ||
o) A second optional incorrect answer here | ||
|
||
|
||
{choose-answers: 4} | ||
? A more complicated example. Note the question mark at the end of the options! Which of the following are correct | ||
1. An option described | ||
2. A second option | ||
3. A third option | ||
4. A fourth option | ||
5. A fifth option ? | ||
|
||
C) All of the examples listed except 5 | ||
C) All of the listed examples except 5 | ||
m) 1, 3, and 5 | ||
m) 1, 2, and 3 | ||
o) All of the examples except 1 and 5 | ||
o) All of the examples listed | ||
|
||
{/quiz} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
AnVIL | ||
BIPOC | ||
Bloomberg | ||
Datatrail | ||
DataTrail | ||
dropdown | ||
GDSCN | ||
impactful | ||
ITCR | ||
itcrtraining | ||
ITN | ||
fyi | ||
Leanpub | ||
Markua | ||
mentorship | ||
NCI | ||
NHGRI | ||
UE | ||
UE5 | ||
reproducibility | ||
underserved | ||
www |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env Rscript | ||
# Written by Candace Savonen March 2022 | ||
|
||
library(optparse) | ||
|
||
check_type <- readLines('check_type.txt') | ||
|
||
print(paste("Check type specified:", opt$check_type)) | ||
|
||
if (check_type == "spelling") source("scripts/spell-check.R") | ||
if (check_type == "urls") source("scripts/url-check.R") | ||
if (check_type == "quiz_format") source("scripts/quiz-check.R") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env Rscript | ||
|
||
# Adapted for this jhudsl repository by Candace Savonen Mar 2022 | ||
|
||
# Run spell check and save results | ||
|
||
library(magrittr) | ||
|
||
# Find .git root directory | ||
root_dir <- rprojroot::find_root(rprojroot::has_dir(".git")) | ||
|
||
ottrpal::check_quizzes(quiz_dir = file.path(root_dir, 'quizzes'), write_report = TRUE, verbose = TRUE) | ||
|
||
if (file.exists("question_error_report.tsv")) { | ||
quiz_errors <- readr::read_tsv("question_error_report.tsv") | ||
|
||
# Print out how many quiz check errors | ||
write(nrow(quiz_errors), stdout()) | ||
} else { | ||
quiz_errors <- data.frame() | ||
|
||
# Print out how many quiz check errors | ||
write("1", stdout()) | ||
} | ||
|
||
if (nrow(quiz_errors) > 0) { | ||
if (!dir.exists("resources")) { | ||
dir.create("resources") | ||
} | ||
# Save question errors to file | ||
readr::write_tsv(quiz_errors, file.path("resources", "question_error_report.tsv")) | ||
} |
Oops, something went wrong.