Add CRAN installation to README #142
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 ] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| check: | |
| name: R-CMD-check (${{ matrix.config.os }} / R ${{ matrix.config.r }}) | |
| runs-on: ${{ matrix.config.os }} | |
| 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: | |
| R_KEEP_PKG_SOURCE: yes | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup R ${{ matrix.config.r }} | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| r-version: ${{ matrix.config.r }} | |
| # Speeds up installs on Ubuntu via RSPM | |
| use-public-rspm: true | |
| - name: Cache R library | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.R_LIBS_USER }} | |
| key: ${{ runner.os }}-R-${{ matrix.config.r }}-${{ hashFiles('renv.lock', 'DESCRIPTION') }} | |
| restore-keys: | | |
| ${{ runner.os }}-R-${{ matrix.config.r }}- | |
| ${{ runner.os }}-R- | |
| - name: Install dependencies | |
| uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| # keep your original extras; adds local package | |
| extra-packages: any::rcmdcheck, any::cmdstanr, local::. | |
| # Enable binary installs on Linux for speed | |
| needs: check | |
| - name: Install cmdstan | |
| run: | | |
| cmdstanr::check_cmdstan_toolchain(fix = TRUE) | |
| cmdstanr::install_cmdstan(cores = 2) | |
| shell: Rscript {0} | |
| - name: R CMD check | |
| uses: r-lib/actions/check-r-package@v2 | |
| with: | |
| args: 'c("--no-manual", "--as-cran")' | |
| # Show full testthat output if something fails | |
| error-on: '"error"' | |
| coverage: | |
| name: test-coverage | |
| needs: check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| r-version: 'release' | |
| - name: Cache R library | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ env.R_LIBS_USER }} | |
| key: ${{ runner.os }}-R-release-${{ hashFiles('renv.lock', 'DESCRIPTION') }} | |
| restore-keys: | | |
| ${{ runner.os }}-R-release- | |
| ${{ runner.os }}-R- | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| extra-packages: any::covr, any::cmdstanr, any::testthat | |
| - name: Install cmdstan | |
| run: | | |
| cmdstanr::check_cmdstan_toolchain(fix = TRUE) | |
| cmdstanr::install_cmdstan(cores = 2) | |
| shell: Rscript {0} | |
| - name: Upload coverage to Codecov | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| run: | | |
| covr::codecov(token = Sys.getenv("CODECOV_TOKEN")) | |
| shell: Rscript {0} |