Fix scenario list (#249) #545
This file contains hidden or 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
| name: R-CMD-check | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| inputs: | |
| git-ref: | |
| description: Git Ref (Optional) | |
| required: false | |
| jobs: | |
| R-CMD-check: | |
| runs-on: ${{ matrix.config.os }} | |
| name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| config: | |
| - {os: windows-latest, r: 'release'} | |
| - {os: windows-latest, r: 'oldrel'} | |
| - {os: macos-latest, r: 'release'} | |
| - {os: macos-latest, r: 'oldrel'} | |
| - {os: ubuntu-22.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"} | |
| - {os: ubuntu-22.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/jammy/latest"} | |
| env: | |
| R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
| RSPM: ${{ matrix.config.rspm }} | |
| steps: | |
| - name: Clone Repository | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: ${{ github.event.inputs.git-ref || github.sha }} | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.config.r }} | |
| - uses: r-lib/actions/setup-pandoc@v2 | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: | | |
| rcmdcheck | |
| hedgehogqa/r-hedgehog | |
| # In case we need to debug, and run each test separately | |
| # - name: Install package from source | |
| # run: Rscript -e 'install.packages(".", repos = NULL, type = "source")' | |
| # | |
| # - name: Run tests individually (R) | |
| # run: | | |
| # library(simstudy) # make sure the package is loaded | |
| # library(testthat) | |
| # test_files <- list.files("tests/testthat", pattern = "^test.*\\.[rR]$", full.names = TRUE) | |
| # for (f in test_files) { | |
| # cat(">>> Running", f, "\n") | |
| # tryCatch({ | |
| # testthat::test_file(f) | |
| # cat("Completed:", f, "\n") | |
| # }, error = function(e) { | |
| # cat("Error in", f, ":", e$message, "\n") | |
| # stop(e) | |
| # }) | |
| # } | |
| # shell: Rscript {0} | |
| # 🧪 Now run the full check | |
| - uses: r-lib/actions/check-r-package@v2 | |