add local option #381
This file contains 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
on: | |
push: | |
branches: | |
- main | |
- devl | |
pull_request: | |
branches: | |
- main | |
- devl | |
name: R-CMD-check | |
jobs: | |
get_message: | |
runs-on: ubuntu-latest | |
outputs: | |
commitmsg: ${{ steps.getmsg.outputs.msg }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
fetch-depth: 0 | |
- name: Set tags env variables | |
id: getmsg | |
run: | | |
# Get your last commit message, not the merge commit. | |
msg=$(git log -1 --no-merges --pretty=%s) | |
echo "msg=$(git log -1 --no-merges --pretty=%s)" >> "$GITHUB_OUTPUT" | |
echo "commit message: $msg" | |
R-CMD-check: | |
needs: get_message | |
runs-on: ${{ matrix.config.os }} | |
if: "!contains(needs.get_message.outputs.commitmsg, '[skip-ci]')" | |
env: | |
_SP_EVOLUTION_STATUS_: 2 | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
R_REPRODUCIBLE_RUN_ALL_EXAMPLES: true | |
R_REPRODUCIBLE_RUN_ALL_TESTS: true | |
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
strategy: | |
fail-fast: false | |
matrix: | |
config: | |
- {os: macOS-latest, r: 'release'} | |
# - {os: windows-latest, r: 'devel'} | |
- {os: windows-latest, r: 'release'} | |
# - {os: windows-latest, r: 'oldrel'} | |
# - {os: windows-latest, r: '4.1'} | |
# - {os: ubuntu-20.04, r: 'devel'} | |
- {os: ubuntu-20.04, r: 'release'} | |
# - {os: ubuntu-20.04, r: 'oldrel'} | |
# - {os: ubuntu-20.04, r: '4.1'} | |
steps: | |
- name: Check commit message | |
run: | | |
echo "${{ needs.get_message.outputs.commitmsg }}" | |
- name: Install X11 dependencies on MacOS | |
if: runner.os == 'macOS' | |
run: | | |
brew install --cask xquartz | |
- uses: actions/checkout@v4 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
Ncpus: 2 | |
r-version: ${{ matrix.config.r }} | |
use-public-rspm: false | |
- uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
extra-packages: | | |
any::plotly | |
any::rcmdcheck | |
any::Rcpp | |
any::remotes | |
any::stinepack | |
any::withr | |
- name: Package checks | |
if: "contains(needs.get_message.outputs.commitmsg, '[skip-tests]')" | |
uses: r-lib/actions/check-r-package@v2 | |
with: | |
args: 'c("--no-manual", "--as-cran", "--no-tests", "--no-examples")' | |
- name: Package checks | |
if: "!contains(needs.get_message.outputs.commitmsg, '[skip-tests]')" | |
uses: r-lib/actions/check-r-package@v2 | |
with: | |
args: 'c("--no-manual", "--as-cran", "--run-dontrun", "--run-donttest")' | |
- name: Show testthat output | |
if: always() | |
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true | |
shell: bash | |
- name: Upload check results | |
if: failure() | |
uses: actions/upload-artifact@main | |
with: | |
name: ${{ runner.os }}-r${{ matrix.config.r }}-results | |
path: check |