Skip to content

Bump r-lib/actions from 2.11.1 to 2.11.2 #343

Bump r-lib/actions from 2.11.1 to 2.11.2

Bump r-lib/actions from 2.11.1 to 2.11.2 #343

Workflow file for this run

################################################################################
# This is the first workflow that requires a different set of testing setup for
# Windows and MacOS than ubuntu, so it's correspondingly more fragile. R is the
# first language dealt with here that doesn't ship a lot of the languages' CI
# functionality with the language itself, but rather through packages, which to
# install repeatedly would be painfully slow, so I've hacked together a messier
# set of make recipes than usual to accommodate all the different calls. The
# main "gotcha" so far has been needing to preface anything that uses TinyTeX
# with the path override LOCALBIN - https://github.com/rstudio/tinytex/issues/16
################################################################################
# All "full test" set use strategy.matrix.version: ['3.5.0', '4.0.0', '4.2.1']
# which is symbolic for "minimum R dependency", "latest major", "latest patch".
# While many sources suggest installing release and devel, we use the specific
# patch version that happened to be released when development started as it ties
# to the container of tidyverse, discussed below, that is used in-tandem.
################################################################################
# https://github.com/rocker-org/rocker-versioned2 on line 16 in the commit
# 30c72e028f4c6cf4d3c031fb64b5b0d63cc94cf7 has an issue r-ver_4.2.1.Dockerfile
# -- the "focal/latest" in the CRAN ENV which can cause the error
# "cannot open URL '<CRAN:ENV>/src/contrib/Meta/current.rds': HTTP status was
# '404 Not Found'" -- so use 4.2.0, which fixes "focal/2022-06-22" for ubuntu.
################################################################################
# This workflow makes use of the rocker/tidyverse container to avoid the lengthy
# and cumbersome installation of debian packages and the compilation of every
# package that devtools requires as the rocker/tidyverse container in the
# minimum spec per https://github.com/rocker-org/rocker that includes devtools.
# The alternative is to use the action to install R;
# r-lib/actions/setup-r@14a7e741c1cb130261263aa1593718ba42cf443b # v2.11.2
# And then install dependencies, packages, and libraries on top. For Mac, we
# simply need to setup R and run the ordinary CMD Check. For windows, we need to
# install rtools to allow the 3.5.0 test to use C:\rtools40\usr\bin\bash.EXE
# instead of C:\Program Files\Git\bin\bash.EXE -- which would otherwise return a
# make: /bin/bash: Command not found -- lucky for us though, we can set the
# rtools-version to 40 to acquire the C:\Rtools40
# https://github.com/r-lib/actions/blob/v2.6.4/setup-r/src/installer.ts#L452-L466
################################################################################
name: R 🏴‍☠️🔵🦜 Tests 🦂
on:
push:
branches-ignore:
- 'main'
paths:
- 'R/**'
- '!R/**.md'
- '!R/.vscode/**'
- '.github/workflows/R-*'
pull_request:
branches:
- 'main'
paths:
- 'R/**'
- '!R/**.md'
- '!R/.vscode/**'
- '.github/workflows/R-*'
schedule: # 9AM on the 15th
- cron: 0 22 14 1,2,3,10,11,12 * # AEDT Months
- cron: 0 23 14 4,5,6,7,8,9 * # AEST Months
workflow_call:
permissions: {}
defaults:
run:
shell: bash
working-directory: R
jobs:
quick-test:
name: R 🏴‍☠️🔵🦜 Quick Test 🦂
if: ${{ github.event_name == 'push' && !(github.event.ref == 'refs/heads/main') }}
runs-on: ubuntu-latest
container:
image: rocker/tidyverse:4.2.1
steps:
- name: 🏁 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🧱 Dependencies - GMP version
run: |-
make setup_debian_gmp
make setup_dependencies
make setup_test_dependencies
- name: 🦂 Test
run: |-
make test
make cmd_check
full-test:
name: R 🏴‍☠️🔵🦜 Full Test 🦂
if: >-
${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.event.ref == 'refs/heads/main') }}
runs-on: ubuntu-latest
container:
image: rocker/tidyverse:${{ matrix.version }}
strategy:
fail-fast: false
matrix:
version: ['3.5.0', '4.0.0', '4.2.0', 'devel']
steps:
- name: 🏁 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
# https://lists.debian.org/debian-devel-announce/2023/03/msg00006.html
# Tidyverse images are pretty old. 3.5 is like a million years old so needs this.
- name: Tidyverse:3.5 Image - Stretch Archive
if: ${{ matrix.version == '3.5.0' }}
run: |-
sed -i -e 's/deb.debian.org/archive.debian.org/g' /etc/apt/sources.list
sed -i -e 's|security.debian.org|archive.debian.org/|g' /etc/apt/sources.list
sed -i -e '/stretch-updates/d' /etc/apt/sources.list
- name: 🧱 Dependencies - GMP version
run: |-
make setup_debian_gmp
make setup_dependencies
make setup_test_dependencies
- name: 🧱 Dependencies for Full Test + Suggests
if: ${{ matrix.version == '4.2.0' || matrix.version == 'devel' }}
run: make setup_everything
- name: 🦂 Test (not cran, no manual)
if: ${{ matrix.version != '4.2.0' }}
run: make check_not_cran_no_pdf
- name: Add the repo as a safe repo inside the job container
run: git config --global --add safe.directory /__w/Collatz/Collatz
- name: 🦂 Test (cran, manual)
if: ${{ matrix.version == '4.2.0' }}
run: make cran_check
mac-cmd-check:
name: R 🏴‍☠️🔵🦜 CMD check (Mac)
if: >-
${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.event.ref == 'refs/heads/main') }}
runs-on: macOS-latest
strategy:
fail-fast: false
matrix:
# 'devel' requires installing knitr and rmarkdown from src which takes ~ 20 minutes
# '3.5.0' no longer has a devtools that'll install? It's fine to remove from here.
version: ['4.0.0', '4.2.1']
steps:
- name: 🏁 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🏴‍☠️🔵🦜 Set up R
uses: r-lib/actions/setup-r@14a7e741c1cb130261263aa1593718ba42cf443b # v2.11.2
with:
r-version: ${{ matrix.version }}
- name: 🐼 Pandoc
uses: r-lib/actions/setup-pandoc@14a7e741c1cb130261263aa1593718ba42cf443b # v2.11.2
with:
pandoc-version: '2.17.1'
- name: TinyTex
uses: r-lib/actions/setup-tinytex@14a7e741c1cb130261263aa1593718ba42cf443b # v2.11.2
- name: TinyTex MakeIndex
run: tlmgr install makeindex
- name: 🧱 Dependencies
run: make setup_mac_tests
- name: 🦂 Test (not cran, no manual)
if: ${{ matrix.version != '4.2.1' }}
run: make check_not_cran_no_pdf
- name: 🦂 Test (cran, manual)
if: ${{ matrix.version == '4.2.1' }}
run: make cran_check
windows-cmd-check:
name: R 🏴‍☠️🔵🦜 CMD check (Win)
if: >-
${{ github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && github.event.ref == 'refs/heads/main') }}
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
# '3.5.0' no longer has the packages as binaries available, only source.
# '4.0.0' still functionally tested in the other jobs, but doesn't play
# well with the " vs ' quote usage that's used in ubuntu / mac. See the
# make setup_win_tests recipe for more information.
version: ['4.2.1', 'devel']
steps:
- name: 🏁 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🏴‍☠️🔵🦜 Set up R
uses: r-lib/actions/setup-r@14a7e741c1cb130261263aa1593718ba42cf443b # v2.11.2
with:
r-version: ${{ matrix.version }}
rtools-version: '40'
- name: 🐼 Pandoc
uses: r-lib/actions/setup-pandoc@14a7e741c1cb130261263aa1593718ba42cf443b # v2.11.2
with:
pandoc-version: '2.17.1'
- name: 🧱 Dependencies
run: make setup_win_tests
# Don't worry about doing a cran check on windows.
- name: 🦂 Test (not cran, no manual)
# if: ${{ matrix.version != '4.2.1' }}
run: make check_not_cran_no_pdf
# - name: 🦂 Test (cran, manual)
# if: ${{ matrix.version == '4.2.1' }}
# run: make cran_check
docs:
name: R 🏴‍☠️🔵🦜 Docs 📄 Quick Test 🦂
runs-on: ubuntu-latest
container:
image: rocker/tidyverse:4.2.1
steps:
- name: 🏁 Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: 🥔 Setup
run: make setup_everything
- name: Add the repo as a safe repo inside the job container
run: git config --global --add safe.directory /__w/Collatz/Collatz
- name: 📄 Docs
run: make docs