Skip to content
Open
Show file tree
Hide file tree
Changes from 9 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
13 changes: 13 additions & 0 deletions .github/revdepcheck/run.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
options(repos = c(CRAN = "https://cloud.r-project.org"))

if (Sys.getenv("PREVIOUS_RUN_ID") == "") {
revdepcheck::revdep_reset()
}

revdepcheck::revdep_check(
num_workers = 3,
timeout = as.difftime(
as.integer(Sys.getenv("TIMEOUT_MINUTES")),
units = "mins"
)
)
22 changes: 22 additions & 0 deletions .github/revdepcheck/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
set -euo pipefail

set +e
timeout -s TERM -k 5m 350m Rscript .github/revdepcheck/run.R
code=$?
set -e

case "$code" in
124|130|137|143)
echo "again=true" >> "$GITHUB_OUTPUT"
exit 0
;;
0)
echo "again=false" >> "$GITHUB_OUTPUT"
exit 0
;;
*)
echo "again=false" >> "$GITHUB_OUTPUT"
exit "$code"
;;
esac
15 changes: 15 additions & 0 deletions .github/run.sh
Comment thread
VisruthSK marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
set -euo pipefail

set +e
timeout -s INT -k 5m 350m Rscript .github/revdepcheck/run.R
code=$?
set -e

if [ "$code" = "124" ] || [ "$code" = "130" ] || [ "$code" = "137" ]; then
echo "again=true" >> "$GITHUB_OUTPUT"
exit 0
fi

echo "again=false" >> "$GITHUB_OUTPUT"
exit "$code"
83 changes: 83 additions & 0 deletions .github/workflows/revdepcheck.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: revdepcheck

on:
workflow_dispatch:
inputs:
timeout_minutes:
description: "Timeout per reverse dependency"
required: false
default: "30"
previous_run_id:
description: "Previous run ID"
required: false
default: ""

permissions:
contents: read
actions: write

concurrency:
group: revdepcheck-${{ github.ref }}
cancel-in-progress: false

jobs:
revdepcheck:
runs-on: ubuntu-latest
timeout-minutes: 360

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
NOT_CRAN: "true"
TIMEOUT_MINUTES: ${{ inputs.timeout_minutes }}
PREVIOUS_RUN_ID: ${{ inputs.previous_run_id }}

steps:
- uses: actions/checkout@v7

- uses: actions/download-artifact@v8
if: ${{ inputs.previous_run_id != '' }}
with:
name: revdep-state
path: revdep
run-id: ${{ inputs.previous_run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: r-lib/revdepcheck
needs: check

- name: Run revdepcheck
id: revdep
run: bash .github/revdepcheck/run.sh

- uses: actions/upload-artifact@v7
if: always()
with:
name: revdep-state
path: revdep/
retention-days: 14
if-no-files-found: ignore

- name: Continue
if: ${{ steps.revdep.outputs.again == 'true' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh workflow run revdepcheck.yaml \
--ref "${{ github.ref_name }}" \
-f timeout_minutes="${{ inputs.timeout_minutes }}" \
-f previous_run_id="${{ github.run_id }}"

- name: Fail on broken revdeps
if: ${{ steps.revdep.outputs.again == 'false' }}
shell: Rscript {0}
run: |
status <- revdepcheck:::report_status(".")
if (status$broken > 0) {
stop(status$broken, " reverse dependencies have new failures.")
}
Loading