diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index d7522af..05e8df6 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -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: @@ -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 }} diff --git a/.github/workflows/covr/action.yml b/.github/workflows/covr/action.yml index 4249d62..76f593a 100644 --- a/.github/workflows/covr/action.yml +++ b/.github/workflows/covr/action.yml @@ -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 diff --git a/.github/workflows/install/action.yml b/.github/workflows/install/action.yml index 451ca2c..c7bb8d0 100644 --- a/.github/workflows/install/action.yml +++ b/.github/workflows/install/action.yml @@ -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) @@ -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 @@ -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 diff --git a/.github/workflows/style/action.yml b/.github/workflows/style/action.yml index 6b40c0a..a5e83a5 100644 --- a/.github/workflows/style/action.yml +++ b/.github/workflows/style/action.yml @@ -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