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
9 changes: 5 additions & 4 deletions .github/workflows/R-CMD-check-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ on:
- "cran-*"
tags:
- "v*"
workflow_dispatch:

name: rcc dev

jobs:
matrix:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}

Expand All @@ -32,7 +33,7 @@ jobs:
uses: ./.github/workflows/dep-matrix

check-matrix:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: matrix

name: Check deps
Expand All @@ -50,7 +51,7 @@ jobs:
echo $matrix | json2yaml

R-CMD-check-base:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

name: base

Expand Down Expand Up @@ -96,7 +97,7 @@ jobs:
- matrix
- R-CMD-check-base

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

name: 'rcc-dev: ${{ matrix.package }}'

Expand Down
56 changes: 47 additions & 9 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
- main
- master
- release
- next
- cran-*
pull_request:
branches:
Expand All @@ -29,6 +30,14 @@ on:
description: "Create a matrix of suggested dependencies"
type: boolean
default: false
run-rcc-full:
description: "Run rcc-full job"
type: boolean
default: false
run-rcc-suggests:
description: "Run rcc-suggests job"
type: boolean
default: false
merge_group:
types:
- checks_requested
Expand Down Expand Up @@ -67,17 +76,16 @@ jobs:
ref: ${{ inputs.ref }}

- name: Update status for rcc
if: github.actor != 'Copilot'
# FIXME: Wrap into action
if: github.event_name == 'workflow_dispatch'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "Actor: ${{ github.actor }}"

# Check status of this workflow
state="pending"
sha=${{ inputs.ref }}
if [ -z "${sha}" ]; then
sha=${{ github.head_ref }}
fi
if [ -z "${sha}" ]; then
sha=${{ github.sha }}
fi
Expand Down Expand Up @@ -174,7 +182,7 @@ jobs:

- name: Update status for rcc
# FIXME: Wrap into action
if: always() && github.event_name == 'workflow_dispatch'
if: always() && (github.actor != 'Copilot')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -190,12 +198,42 @@ jobs:
sha=${{ inputs.ref }}
fi
if [ -z "${sha}" ]; then
sha=${{ github.head_ref }}
sha=${{ github.sha }}
fi
sha=$(git rev-parse ${sha})

html_url=$(gh api \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
repos/${{ github.repository }}/actions/runs/${{ github.run_id }} | jq -r .html_url)

description="${{ github.workflow }} / ${{ github.job }}"

gh api \
--method POST \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
repos/${{ github.repository }}/statuses/${sha} \
-f "state=${state}" -f "target_url=${html_url}" -f "description=${description}" -f "context=rcc"
shell: bash

- name: Update status for rcc (Copilot)
# Update status directly when triggered by Copilot or bots, since they can't dispatch workflows
if: always() && (github.actor == 'Copilot')
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Set status to success if job succeeded, failure otherwise
if [ "${{ job.status }}" == "success" ]; then
state="success"
else
state="failure"
fi
sha=${{ inputs.ref }}
if [ -z "${sha}" ]; then
sha=${{ github.sha }}
fi
sha=$(git rev-parse ${sha})
sha=$(git rev-parse ${sha})

html_url=$(gh api \
-H "Accept: application/vnd.github+json" \
Expand Down Expand Up @@ -239,7 +277,7 @@ jobs:

runs-on: ${{ matrix.os }}

if: ${{ needs.rcc-smoke.outputs.versions-matrix != '' }}
if: ${{ needs.rcc-smoke.outputs.versions-matrix != '' && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.run-rcc-full)) }}

name: 'rcc: ${{ matrix.os }} (${{ matrix.r }}) ${{ matrix.desc }}'

Expand Down Expand Up @@ -301,7 +339,7 @@ jobs:

runs-on: ubuntu-22.04

if: ${{ needs.rcc-smoke.outputs.dep-suggests-matrix != '' }}
if: ${{ needs.rcc-smoke.outputs.dep-suggests-matrix != '' && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.run-rcc-suggests)) }}

name: Without ${{ matrix.package }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ runs:
protected=${{ github.ref_protected }}
foreign=${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
is_pr=${{ github.event_name == 'pull_request' }}
if [ "${is_pr}" = "true" ]; then
if [ "${is_pr}" = "true" ] && [ "${foreign}" = "true" ]; then
# Running on a PR - will use reviewdog in next step
echo "Code changes detected on PR, will suggest changes via reviewdog"
echo "use_reviewdog=true" | tee -a $GITHUB_OUTPUT
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/copilot-setup-steps.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml

jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest

# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
contents: read

# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Checkout code
uses: actions/checkout@v5
- uses: ./.github/workflows/custom/before-install
if: hashFiles('.github/workflows/custom/before-install/action.yml') != ''

- uses: ./.github/workflows/install
with:
token: ${{ secrets.GITHUB_TOKEN }}
cache-version: copilot
needs: build, check, website
# Beware of using dev pkgdown here, has brought in dev dependencies in the past
extra-packages: any::rcmdcheck r-lib/roxygen2 any::decor r-lib/styler r-lib/pkgdown deps::.

- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''

# Must come after the custom after-install workflow
- name: Install package
run: |
UserNM=true R CMD INSTALL . || true
shell: bash

- name: Install air
uses: posit-dev/setup-air@v1
2 changes: 1 addition & 1 deletion .github/workflows/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ runs:
pak-version: stable
needs: ${{ inputs.needs }}
packages: ${{ inputs.packages }}
extra-packages: ${{ inputs.extra-packages }} ${{ ( matrix.covr && 'r-lib/covr#611 xml2' ) || '' }} ${{ steps.get-extra.outputs.packages }}
extra-packages: ${{ inputs.extra-packages }} ${{ ( matrix.covr && 'r-lib/covr xml2' ) || '' }} ${{ steps.get-extra.outputs.packages }}
cache-version: ${{ inputs.cache-version }}

- name: Add pkg.lock to .gitignore
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/update-snapshots/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ runs:
pattern <- paste0(patterns, collapse = "|")
tryCatch(
{
result <- as.data.frame(testthat::test_local(pattern = pattern, reporter = "silent", stop_on_failure = FALSE))
print(result)
Sys.setenv(TESTTHAT_PARALLEL = FALSE)
result <- as.data.frame(testthat::test_local(pattern = pattern, reporter = "location", stop_on_failure = FALSE))
failures <- result[result$failed + result$warning > 0, ]
print(failures)
if (nrow(failures) > 0) {
writeLines("Snapshot tests failed/warned.")
print(failures[names(failures) != "result"])
Expand Down
Loading