diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml deleted file mode 100644 index ff6150f..0000000 --- a/.github/workflows/R-CMD-check.yaml +++ /dev/null @@ -1,96 +0,0 @@ -# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag. -# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions -name: R CMD check - -on: - push: - branches: - - main - pull_request: - branches: - - main - schedule: - - cron: "0 0 * * 2" - workflow_dispatch: - -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: macOS-latest, r: 'release'} - - {os: ubuntu-20.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"} - - env: - RSPM: ${{ matrix.config.rspm }} - - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@v1 - with: - r-version: ${{ matrix.config.r }} - - - uses: r-lib/actions/setup-pandoc@v1 - - - name: Install cURL on Ubuntu - if: runner.os == 'Linux' - run: sudo apt-get install -y libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev - - - name: Install libgit2 on macOS - # Required only for source install of ‘gert’, but this can happen - # accidentally (and has!) when ‘gert’ is being updated and the CRAN - # server hasn’t yet built the new binary packages. - if: runner.os == 'macOS' - run: brew install libgit2 - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), '.github/r-depends.rds', version = 2L) - writeLines(sprintf('R-%i.%i', getRversion()$major, getRversion()$minor), '.github/r-version') - shell: Rscript {0} - - - name: Cache R packages - if: runner.os != 'Windows' - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/r-version') }}-1-${{ hashFiles('.github/r-depends.rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/r-version') }}-1- - - - name: Install R package dependencies - run: | - install.packages(c('remotes', 'rcmdcheck')) - remotes::install_deps(dependencies = TRUE) - shell: Rscript {0} - - - name: Build package for checking - run: | - # Workaround for bug #1070 in roxygen2 7.1.0 - writeLines('# Generated by roxygen2: do not edit by hand', 'NAMESPACE') - devtools::document() - shell: Rscript {0} - - - name: Check - env: - _R_CHECK_CRAN_INCOMING_REMOTE_: false - run: | - options(crayon.enabled = TRUE) - rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "error", check_dir = "check") - shell: Rscript {0} - - - name: Upload check results on failure - if: failure() - uses: actions/upload-artifact@main - with: - name: ${{ runner.os }}-r${{ matrix.config.r }}-results - path: check diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index dc5d024..6c78667 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,8 +2,7 @@ name: Dev build on: push: - branches: - - main + branches: [main] workflow_dispatch: jobs: @@ -12,34 +11,11 @@ jobs: runs-on: ubuntu-latest steps: - - name: Check out code - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - name: Set up R - uses: r-lib/actions/setup-r@v1 + - uses: r-lib/actions/setup-r@v2 - - name: Install external library dependencies - run: sudo apt-get install -y libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev - - - name: Query dependencies - run: | - install.packages('remotes') - saveRDS(remotes::dev_package_deps(dependencies = TRUE), '.github/r-depends.rds', version = 2L) - writeLines(sprintf('R-%i.%i', getRversion()$major, getRversion()$minor), '.github/r-version') - shell: Rscript {0} - - - name: Cache R library - uses: actions/cache@v2 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ hashFiles('.github/r-version') }}-2-${{ hashFiles('.github/r-depends.rds') }} - restore-keys: ${{ hashFiles('.github/r-version') }}-2- - - - name: Install R package dependencies - run: | - install.packages(c('remotes', 'rcmdcheck')) - remotes::install_deps(dependencies = TRUE) - shell: Rscript {0} + - uses: r-lib/actions/setup-r-dependencies@v2 - name: Build package run: | @@ -59,4 +35,4 @@ jobs: git checkout -b dev git add --force NAMESPACE man git commit -m 'Create a development release' - git push --force --set-upstream origin dev + git push --force origin dev diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 0000000..eca398f --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,57 @@ +name: R CMD check + +on: + push: + branches: [main] + pull_request: + branches: [main] + schedule: + - cron: "0 0 * * 2" + workflow_dispatch: + +jobs: + 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: macOS-latest, r: 'release'} + - {os: ubuntu-20.04, r: 'oldrel'} + - {os: ubuntu-20.04, r: 'release'} + - {os: ubuntu-20.04, r: 'devel', http-user-agent: ' release'} + + 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 + + - name: Build package for checking + run: | + # Workaround for bug #1070 in roxygen2 7.1.0 + writeLines('# Generated by roxygen2: do not edit by hand', 'NAMESPACE') + devtools::document() + shell: Rscript {0} + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true