Skip to content

Commit

Permalink
add git workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jaytimm committed Aug 7, 2024
1 parent c6eb493 commit 4ced2bc
Show file tree
Hide file tree
Showing 9 changed files with 165 additions and 91 deletions.
1 change: 1 addition & 0 deletions .github/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.html
49 changes: 49 additions & 0 deletions .github/workflows/check-standard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {os: windows-latest, r: 'release'}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
48 changes: 48 additions & 0 deletions .github/workflows/pkgdown.yaml
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
50 changes: 50 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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]

name: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}

- name: Show testthat output
if: always()
run: |
## --------------------------------------------------------------------
find ${{ runner.temp }}/package -name 'testthat.Rout*' -exec cat '{}' \; || true
shell: bash

- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

export(hollr)
export(hollr_local_batches)
export(pretty_prompt)
import(data.table)
importFrom(httr,POST)
importFrom(httr,add_headers)
Expand Down
47 changes: 0 additions & 47 deletions R/pretty_prompt.R

This file was deleted.

22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ reticulate::use_condaenv(condaenv = env_name, conda = file.path(miniconda_path,
> `hollr` includes some sample prompts and text data.
``` r
hollr::pretty_prompt(hollr::prompts$FeaturizeTextYN)
pretty_prompt(hollr::prompts$FeaturizeTextYN)
```

## Role
Expand Down Expand Up @@ -179,16 +179,16 @@ class_task1 |> knitr::kable()

| id | annotator_id | attempts | success | pol_ideo | survey_long | demo_geo | health_policy | misinfo_media_trust |
|:------|:--------|------:|:-----|:------|:--------|:------|:---------|:-------------|
| 30247057 | PJniT5IsvD | 1 | TRUE | TRUE | TRUE | FALSE | FALSE | TRUE |
| 37947551 | PJniT5IsvD | 1 | TRUE | TRUE | FALSE | TRUE | TRUE | FALSE |
| 28895229 | PJniT5IsvD | 1 | TRUE | TRUE | FALSE | FALSE | TRUE | FALSE |
| 34341651 | PJniT5IsvD | 1 | TRUE | TRUE | FALSE | TRUE | TRUE | FALSE |
| 25316309 | PJniT5IsvD | 1 | TRUE | FALSE | FALSE | FALSE | TRUE | FALSE |
| 22904584 | PJniT5IsvD | 1 | TRUE | TRUE | TRUE | FALSE | FALSE | FALSE |
| 7183563 | PJniT5IsvD | 1 | TRUE | TRUE | TRUE | FALSE | TRUE | FALSE |
| 33199928 | PJniT5IsvD | 1 | TRUE | TRUE | TRUE | TRUE | TRUE | FALSE |
| 35270435 | PJniT5IsvD | 1 | TRUE | TRUE | TRUE | TRUE | FALSE | FALSE |
| 35250760 | PJniT5IsvD | 1 | TRUE | TRUE | TRUE | TRUE | FALSE | TRUE |
| 30247057 | UPo2EAwCka | 1 | TRUE | TRUE | TRUE | FALSE | FALSE | TRUE |
| 37947551 | UPo2EAwCka | 1 | TRUE | TRUE | FALSE | TRUE | TRUE | FALSE |
| 28895229 | UPo2EAwCka | 1 | TRUE | TRUE | FALSE | FALSE | TRUE | FALSE |
| 34341651 | UPo2EAwCka | 1 | TRUE | TRUE | TRUE | TRUE | TRUE | FALSE |
| 25316309 | UPo2EAwCka | 1 | TRUE | FALSE | FALSE | FALSE | TRUE | FALSE |
| 22904584 | UPo2EAwCka | 1 | TRUE | TRUE | TRUE | FALSE | FALSE | FALSE |
| 7183563 | UPo2EAwCka | 1 | TRUE | TRUE | TRUE | FALSE | TRUE | FALSE |
| 33199928 | UPo2EAwCka | 1 | TRUE | TRUE | TRUE | TRUE | TRUE | FALSE |
| 35270435 | UPo2EAwCka | 1 | TRUE | TRUE | TRUE | TRUE | FALSE | FALSE |
| 35250760 | UPo2EAwCka | 1 | TRUE | TRUE | TRUE | TRUE | FALSE | TRUE |

### Parallel processing

Expand Down
8 changes: 6 additions & 2 deletions data-raw/prompts/FeaturizeTextYN.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ survey_long: Is the research based on survey data collection or involves longitu
demo_geo: Does the abstract include an analysis of demographic factors (e.g., age, gender, education) or mention geographic/regional differences within the United States?
health_policy: Is the study related to public health issues, or does it address implications for policymakers or public health interventions?
misinfo_media_trust: Does the abstract discuss misinformation, media impact, or trust in government/public institutions?
Example Input



Example Input:

"Personal similarities to a transgressor makes one view the transgression as less immoral. We investigated whether personal relevance might also affect the perceived immorality of politically-charged threats. We hypothesized that increasing the personal relevance of a threat would lead participants to report the threat as more immoral, even for threats the participant might otherwise view indifferently. U.S. participants recruited online (N = 488) were randomly assigned to write about the personal relevance of either a liberal threat (pollution), conservative threat (disrespecting an elder), neutral threat (romantic infidelity), or given a control filler task. Participants then rated how immoral and personally relevant each political threat was, as well as reported their political ideology. Partial support for our hypothesis emerged: when primed with conservative writing prompts, liberal-leaning participants rated the conservative threat as more immoral, compared with the same threat after a liberal writing prompt. We did not find these results for conservative-leaning participants, perhaps because all participants cared relatively equally about the liberal threat."



Expected Output
Expected Output:

{
"pol_ideo": true,
Expand Down
30 changes: 0 additions & 30 deletions man/pretty_prompt.Rd

This file was deleted.

0 comments on commit 4ced2bc

Please sign in to comment.