Skip to content

Commit

Permalink
Merge pull request #68 from venpopov/feature/issue-61-add-github-acti…
Browse files Browse the repository at this point in the history
…on-to-run-check-on-pull-requests

Feature/issue 61 add GitHub action to run check on pull requests
  • Loading branch information
GidonFrischkorn authored Feb 7, 2024
2 parents dc091c2 + 050f769 commit 06a963c
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 10 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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: [master, develop]
pull_request:
branches: [master, develop]

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: 'release'}

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

steps:
- uses: actions/checkout@v4

- 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
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [master, develop]
pull_request:
branches: [master, develop]
branches: [master]
release:
types: [published]
workflow_dispatch:
Expand Down
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: [master, develop]
pull_request:
branches: [master, develop]

name: test-coverage

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

steps:
- uses: actions/checkout@v4

- 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@v4
with:
name: coverage-test-failures
path: ${{ runner.temp }}/package
5 changes: 4 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ knitr::opts_chunk$set(
out.width = "100%"
)
```
# bmm <!-- badges: start --> <!-- badges: end -->
# bmm <!-- badges: start -->
[![R-CMD-check](https://github.com/venpopov/bmm/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/venpopov/bmm/actions/workflows/R-CMD-check.yaml)
[![test-coverage](https://github.com/venpopov/bmm/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/venpopov/bmm/actions/workflows/test-coverage.yaml)
<!-- badges: end -->

The goal of bmm (Bayesian Measurement Models) is to make it easier to estimate
common measurement models for behavioral research using Bayesian hierarhical
Expand Down
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@

<!-- README.md is generated from README.Rmd. Please edit that file -->

# bmm <!-- badges: start --> <!-- badges: end -->
# bmm <!-- badges: start -->

[![R-CMD-check](https://github.com/venpopov/bmm/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/venpopov/bmm/actions/workflows/R-CMD-check.yaml)
[![test-coverage](https://github.com/venpopov/bmm/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/venpopov/bmm/actions/workflows/test-coverage.yaml)
<!-- badges: end -->

The goal of bmm (Bayesian Measurement Models) is to make it easier to
estimate common measurement models for behavioral research using
Expand Down Expand Up @@ -76,13 +80,13 @@ library(bmm)
library(tidyverse)
dat <- gen_3p_data(N=2000, pmem=0.6, pnt=0.3, kappa=10, setsize=4, relative_resp=T)
head(dat)
#> y nt1_loc nt2_loc nt3_loc
#> 1 -0.142526610 2.1500293 -0.6441928 0.9517516
#> 2 0.007518355 -3.0287546 -2.9828635 2.0714670
#> 3 0.018662539 -1.3783199 1.0946707 1.2723605
#> 4 -0.004285611 1.7142538 -1.8425466 0.7009981
#> 5 0.396037655 -0.7615063 1.6378873 2.8464744
#> 6 -0.411727832 -0.9225579 2.5400559 3.0250659
#> y nt1_loc nt2_loc nt3_loc
#> 1 0.51775824 1.0020511 0.76339413 -1.2897954
#> 2 0.03960327 -0.6206519 1.09208784 -0.8679937
#> 3 -0.48213423 1.1447270 2.81885045 -1.4363374
#> 4 -0.34510101 2.7482095 -0.06612305 2.0340003
#> 5 0.09348744 -1.3952246 2.17738363 0.7796131
#> 6 0.39001975 -0.8049496 2.07371921 -1.1887811
```

We have a dataset of 2000 observations of response error, of which 60%
Expand Down
Binary file modified man/figures/README-unnamed-chunk-4-1.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 modified man/figures/README-unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 06a963c

Please sign in to comment.