Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,8 @@ jobs:
fail-fast: false
matrix: ${{fromJson(needs.rcc-smoke.outputs.versions-matrix)}}

timeout-minutes: 240

steps:
- uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -289,6 +291,7 @@ jobs:
results: ${{ runner.os }}-r${{ matrix.r }}

- uses: ./.github/workflows/covr
timeout-minutes: 240
if: ${{ matrix.covr }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/covr/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: "Actions to run covr for an R package"
description: "Run covr to check code coverage for an R package and upload results to Codecov."
inputs:
token:
description: codecov token
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ runs:
# echo "_R_CHECK_CRAN_INCOMING_=true" | tee -a $GITHUB_ENV
echo "_R_CHECK_CRAN_INCOMING_SKIP_LARGE_VERSION_=true" | tee -a $GITHUB_ENV
echo "_R_CHECK_FORCE_SUGGESTS_=false" | tee -a $GITHUB_ENV
echo "_R_CHECK_THINGS_IN_OTHER_DIRS_=true" | tee -a $GITHUB_ENV
shell: bash

- name: Set environment variables (non-Windows only)
Expand Down Expand Up @@ -94,7 +95,7 @@ runs:
- id: get-extra
run: |
set -x
packages=$( ( grep Config/gha/extra-packages DESCRIPTION || true ) | cut -d " " -f 2)
packages=$( ( grep Config/gha/extra-packages DESCRIPTION || true ) | cut -d " " -f 2-)
echo packages=$packages >> $GITHUB_OUTPUT
shell: bash

Expand All @@ -105,7 +106,7 @@ runs:
pak-version: stable
needs: ${{ inputs.needs }}
packages: ${{ inputs.packages }}
extra-packages: ${{ inputs.extra-packages }} ${{ ( matrix.covr && 'covr xml2' ) || '' }} ${{ steps.get-extra.outputs.packages }}
extra-packages: ${{ inputs.extra-packages }} ${{ ( matrix.covr && 'r-lib/covr#611 xml2' ) || '' }} ${{ steps.get-extra.outputs.packages }}
cache-version: ${{ inputs.cache-version }}

- name: Add pkg.lock to .gitignore
Expand Down
70 changes: 15 additions & 55 deletions .github/workflows/style/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,69 +3,29 @@ name: "Action to auto-style a package"
runs:
using: "composite"
steps:
- name: Check styler options
- name: Check air.toml
id: check
run: |
set -x
scope=$( ( grep Config/autostyle/scope DESCRIPTION || true ) | cut -d " " -f 2)
strict=$( ( grep Config/autostyle/strict DESCRIPTION || true ) | cut -d " " -f 2)
rmd=$( ( grep Config/autostyle/rmd DESCRIPTION || true ) | cut -d " " -f 2)
echo scope=$scope >> $GITHUB_OUTPUT
echo strict=$strict >> $GITHUB_OUTPUT
echo rmd=$rmd >> $GITHUB_OUTPUT
if [ -f air.toml ]; then
echo enabled=true >> $GITHUB_OUTPUT
else
echo enabled=false >> $GITHUB_OUTPUT
fi
shell: bash

- uses: actions/cache@v4
if: ${{ steps.check.outputs.scope }}
with:
path: |
~/.cache/R/R.cache
key: ${{ runner.os }}-2-${{ github.run_id }}-
restore-keys: |
${{ runner.os }}-2-
- name: Install air
if: ${{ steps.check.outputs.enabled == 'true' }}
uses: posit-dev/setup-air@v1

- name: Imprint run ID
if: ${{ steps.check.outputs.scope }}
- name: Run air
if: ${{ steps.check.outputs.enabled == 'true' }}
run: |
mkdir -p ~/.cache/R/R.cache/styler
touch ~/.cache/R/R.cache/${{ github.run_id }}
air format .
shell: bash

- name: Show cache
if: ${{ steps.check.outputs.scope }}
- name: Check Git status
if: ${{ steps.check.outputs.enabled == 'true' }}
run: |
ls -l ~/.cache/R/R.cache
ls -l ~/.cache/R/R.cache/styler
shell: bash

- name: Enable styler cache
if: ${{ steps.check.outputs.scope }}
run: |
styler::cache_activate(verbose = TRUE)
shell: Rscript {0}

- name: Run styler
if: ${{ steps.check.outputs.scope }}
run: |
strict <- as.logical("${{ steps.check.outputs.strict }}")
if (is.na(strict)) {
strict <- FALSE
}
rmd <- as.logical("${{ steps.check.outputs.rmd }}")
if (is.na(rmd)) {
rmd <- TRUE
}
styler::style_pkg(
scope = "${{ steps.check.outputs.scope }}",
strict = strict,
filetype = c("R", "Rprofile", if (rmd) c("Rmd", "Rmarkdown", "Rnw", "Qmd"))
)
shell: Rscript {0}

- name: Show cache again
if: ${{ steps.check.outputs.scope }}
run: |
ls -l ~/.cache/R/R.cache
ls -l ~/.cache/R/R.cache/styler
gdu -s --inodes ~/.cache/R/R.cache/styler/* || du -s --inodes ~/.cache/R/R.cache/styler/*
git status
shell: bash