Skip to content

pkgcheck

pkgcheck #101

Workflow file for this run

name: pkgcheck
# This will cancel running jobs once a new run is triggered
concurrency:
group: >-
${{ github.workflow }}-${{
github.event.workflow_run.head_branch || github.ref }}
cancel-in-progress: true
# Chained to R-CMD-check rather than triggered directly by the push.
#
# pkgcheck's own "continuous integration" check calls the GitHub API for
# push-triggered runs, groups them by workflow name, keeps the most recently
# *created* run of each workflow whose name matches "cmd" or "coverage", and
# requires conclusion == "success". A run still in progress has a null
# conclusion, which the check treats as a failure; it does not fall back to the
# previous completed run. It excludes this workflow, so this is not recursion.
#
# The query runs early: pkgcheck() calls pkgcheck_fill_info(), which performs
# it, *before* pkgcheck_fill_goodpractice(), which is the slow rcmdcheck and
# covr phase. In practice the query happens roughly five minutes into the run,
# not at the end. When all workflows start together on a push, R-CMD-check
# would have to finish inside those five minutes to be read as successful, and
# it cannot: its fastest single matrix leg is over six minutes and the run only
# completes when all five finish (best observed total, 10m32s). So the report
# would say
#
# Package fails continuous integration checks.
#
# on essentially every push, even though R-CMD-check, test-coverage and lint
# all pass. This is not self-correcting, and it is not caused by R-CMD-check
# being unusually slow.
#
# Waiting for R-CMD-check to complete removes it. The cost is a serialised run:
# about 10 minutes for R-CMD-check, then about 15 for pkgcheck, rather than the
# two overlapping.
on:
# Manually trigger the Action under Actions/pkgcheck
workflow_dispatch:
workflow_run:
workflows: ["R-CMD-check.yaml"]
types:
- completed
branches:
- main
jobs:
pkgcheck:
runs-on: ubuntu-latest
permissions:
issues: write
env:
REVISER_FULL_TESTS: "true"
steps:
# pkgcheck-action checks the repo out on the host (as uid 1001), then
# runs its checks in a Docker container as root. libgit2 in the image
# refuses to open a repository owned by a different user, so the job
# dies on the first git call:
#
# repository path '/github/workspace/' is not owned by current user
#
# The container mounts $RUNNER_TEMP/_github_home as its HOME, so writing
# the git configuration there is what reaches it. Nothing in the package
# can prevent this; the image is pinned upstream to :latest and started
# enforcing ownership validation.
- name: Mark the workspace safe for the pkgcheck container
run: |
mkdir -p "${RUNNER_TEMP}/_github_home"
git config --file "${RUNNER_TEMP}/_github_home/.gitconfig" \
--add safe.directory /github/workspace
- uses: ropensci-review-tools/pkgcheck-action@main
continue-on-error: false
with:
post-to-issue: false