-
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 branch 'main' into ki/refactor
- Loading branch information
Showing
138 changed files
with
5,307 additions
and
6,249 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
Binary file not shown.
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
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,48 @@ | ||
# Check up on the testthat results | ||
# C. Savonen | ||
# Nov 2023 | ||
|
||
library(magrittr) | ||
|
||
|
||
# Find .git root directory | ||
root_dir <- rprojroot::find_root(rprojroot::has_dir(".git")) | ||
|
||
# Read in the testthat results | ||
out_file <- list.files(pattern = "testthat.Rout$|Rout.fail$", file.path(root_dir, "check"), | ||
recursive = TRUE, full.names = TRUE) | ||
|
||
# Extract testhat results | ||
testthat_check_content <- readLines(out_file) | ||
testthat_result <- grep("\\[ FAIL", testthat_check_content, value = TRUE)[1] | ||
testthat_result <- unlist(strsplit(testthat_result, "\\||\\[|\\]")) | ||
|
||
# Read in standard check results | ||
check_content <- readLines(file.path(root_dir, "check", "ottrpal.Rcheck", "00check.log")) | ||
|
||
# Extract standard check results | ||
check_result <- grep("Status\\:", check_content, value = TRUE) | ||
check_result <- unlist(strsplit(check_result, ",")) | ||
check_result <- stringr::str_remove(check_result, "Status:| ") | ||
|
||
# Format the data into a dataframe | ||
testthat_result_df <- data.frame(result = trimws(testthat_result)) %>% | ||
dplyr::filter(result != "") %>% | ||
tidyr::separate(result, sep = " ", into = c("test_name", "num")) %>% | ||
dplyr::mutate(num = as.numeric(num)) | ||
|
||
# Do the same for the check results | ||
check_result_df <- data.frame(result = trimws(check_result)) %>% | ||
tidyr::separate(result, sep = " ", into = c("num", "test_name")) %>% | ||
dplyr::mutate(num = as.numeric(num)) %>% | ||
dplyr::select("test_name", "num") | ||
|
||
# We only want warnings or errors or fails | ||
fail_num <- dplyr::bind_rows(check_result_df, testthat_result_df) %>% | ||
dplyr::filter(test_name %in% c("FAIL", "WARN", "WARNINGs", "ERROR")) %>% | ||
dplyr::summarize(total = sum(num)) | ||
|
||
fail_num <- as.character(fail_num$total) | ||
|
||
# Spit the number out | ||
writeLines(fail_num, con = stdout()) |
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,62 @@ | ||
# Candace Savonen Jan 2024 | ||
|
||
name: Build Docker | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
dockerhubpush: | ||
description: 'Push to Dockerhub?' | ||
required: true | ||
default: 'false' | ||
|
||
jobs: | ||
build-docker: | ||
name: Build Docker image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{secrets.GH_PAT}} | ||
fetch-depth: 0 | ||
|
||
# Set up Docker build | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# Setup layer cache | ||
- name: Cache Docker layers | ||
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Get token | ||
run: echo ${{ secrets.GH_PAT }} > ${{ github.workspace }}/inst/extdata/docker/git_token.txt | ||
|
||
# Build docker image | ||
- name: Build Docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
push: false | ||
load: true | ||
context: inst/extdata/docker | ||
tags: cansav09/metricminer | ||
|
||
# Login to Dockerhub | ||
- name: Login to DockerHub | ||
if: ${{ github.event.inputs.dockerhubpush != 'false' }} | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# Push the Docker image if set to true from a manual trigger | ||
- name: Push Docker image if manual trigger set to true | ||
if: ${{ github.event.inputs.dockerhubpush != 'false' }} | ||
run: | | ||
docker push cansav09/metricminer |
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,48 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
name: pkgdown | ||
|
||
jobs: | ||
pkgdown: | ||
runs-on: ubuntu-latest | ||
# Only restrict concurrency for non-PR jobs | ||
concurrency: | ||
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::pkgdown, local::. | ||
needs: website | ||
|
||
- name: Build site | ||
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) | ||
shell: Rscript {0} | ||
|
||
- name: Deploy to GitHub pages 🚀 | ||
if: github.event_name != 'pull_request' | ||
uses: JamesIves/[email protected] | ||
with: | ||
clean: false | ||
branch: gh-pages | ||
folder: docs |
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,3 @@ | ||
Version: 1.2.1 | ||
Date: 2024-01-09 15:20:24 UTC | ||
SHA: 60a69efa2a507c472471cf7ffb7c8d7d370d66ab |
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,7 +1,7 @@ | ||
Type: Package | ||
Package: ottrpal | ||
Title: Companion Tools for Open-Source Tools for Training Resources (OTTR) | ||
Version: 1.2.1 | ||
Version: 1.3.0 | ||
Authors@R: c( | ||
person("Candace", "Savonen", , c("[email protected]","[email protected]"), role = c("aut", "cre"), | ||
comment = c(ORCID = "0000-0001-6331-7070")), | ||
|
@@ -23,7 +23,6 @@ Imports: | |
curl, | ||
dplyr, | ||
fs, | ||
glue, | ||
httr, | ||
jsonlite, | ||
knitr (>= 1.33), | ||
|
@@ -41,7 +40,7 @@ Imports: | |
Suggests: | ||
remotes, | ||
cow, | ||
testthat, | ||
testthat (>= 3.0.0), | ||
tibble, | ||
utils | ||
VignetteBuilder: | ||
|
@@ -50,3 +49,4 @@ ByteCompile: true | |
Encoding: UTF-8 | ||
LazyData: true | ||
RoxygenNote: 7.3.1 | ||
Config/testthat/edition: 3 |
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
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
Oops, something went wrong.