Use with GitHub Actions
GitHub Actions is currently en vogue and popular due to fairly unlimited build resources, along with the
stunning own-goal scored by the previous incumbent. Usage with run.sh is easy. Just commit any file
ending in .yml or .yaml in a directory .github/workflows within your GitHub
repo---and you are all set. No additional registration is needed.
Below is an (adapted) example .github/workflows/ci.yaml from the RcppInt64 repository running a simple matrix build over Linux and macOS---and over two containers.
The containers offer, respectively, use of R-devel and a possibly slightly faster r2u setup (as times for this can vary at GitHub).
Note that the matrix build for any one of these can be turned off by placing a simple comment # character in
front as can be seen in many example YAML files. Also note that this
version now use the GitHub Action for r-ci
(instead of the standard curl use shown in the other examples)
which also includes the bootstrap step.
Lastly, one can uncomment the dumping of logs in case of failures, and
enable coverage as some of my repos do. (Note that you need to set a
repository secret under the name `CODECOV_TOKEN` with the supplied token string.)
For convenience this ci.yaml can also be downloaded.
# Run CI for R using https://eddelbuettel.github.io/r-ci/
name: ci
on:
push:
pull_request:
env:
_R_CHECK_FORCE_SUGGESTS_: "false"
jobs:
ci:
strategy:
matrix:
include:
- { name: container, os: ubuntu-latest, container: rocker/r2u4ci }
- { name: r-devel, os: ubuntu-latest, container: rocker/drd }
- { name: macos, os: macos-latest }
- { name: ubuntu, os: ubuntu-latest }
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup
uses: eddelbuettel/github-actions/r-ci@master
- name: Dependencies
run: ./run.sh install_all
- name: Test
run: ./run.sh run_tests
#- name: Logs
# run: ./run.sh dump_logs
# if: failure()
#- name: Coverage
# if: ${{ matrix.os == 'ubuntu-latest' }}
# run: ./run.sh coverage
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}