Skip to content

Commit

Permalink
Merge branch 'main' of github.com:poissonconsulting/chk
Browse files Browse the repository at this point in the history
  • Loading branch information
joethorley committed Dec 20, 2024
2 parents 08cc464 + 4de0175 commit 68f5e97
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 32 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/R-CMD-check-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}

- uses: r-lib/actions/setup-r@v2
with:
install-r: false

- id: set-matrix
uses: ./.github/workflows/dep-matrix
Expand Down Expand Up @@ -70,7 +68,6 @@ jobs:

- uses: ./.github/workflows/install
with:
install-r: false
cache-version: rcc-dev-base-1
needs: check
extra-packages: "any::rcmdcheck any::remotes ."
Expand Down Expand Up @@ -118,7 +115,6 @@ jobs:

- uses: ./.github/workflows/install
with:
install-r: false
cache-version: rcc-dev-${{ matrix.package }}-1
needs: check
extra-packages: "any::rcmdcheck any::remotes ."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check-status.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ name: rcc-status

jobs:
rcc-status:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

name: "Update commit status"

Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ name: rcc

jobs:
rcc-smoke:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
sha: ${{ steps.commit.outputs.sha }}
versions-matrix: ${{ steps.versions-matrix.outputs.matrix }}
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
cache-version: rcc-smoke-2
needs: 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@f-readme-tweak deps::.
extra-packages: any::rcmdcheck r-lib/roxygen2 any::decor r-lib/styler r-lib/pkgdown deps::.

- name: Install package
run: |
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
shell: bash

rcc-smoke-check-matrix:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

name: "Check matrix"

Expand Down Expand Up @@ -267,6 +267,8 @@ jobs:
with:
results: ${{ runner.os }}-r${{ matrix.r }}

# The status update is taken care of by R-CMD-check-status.yaml

rcc-suggests:
needs:
- rcc-smoke
Expand All @@ -292,7 +294,6 @@ jobs:

- uses: ./.github/workflows/install
with:
install-r: false
cache-version: rcc-dev-${{ matrix.package }}-1
needs: check
extra-packages: "any::rcmdcheck any::remotes ."
Expand Down Expand Up @@ -340,3 +341,5 @@ jobs:
- uses: ./.github/workflows/check
with:
results: ${{ matrix.package }}

# The status update is taken care of by R-CMD-check-status.yaml
36 changes: 25 additions & 11 deletions .github/workflows/fledge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ concurrency:

jobs:
check_fork:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
is_forked: ${{ steps.check.outputs.is_forked }}
steps:
Expand All @@ -33,7 +33,7 @@ jobs:
shell: bash

fledge:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs: check_fork
if: needs.check_fork.outputs.is_forked == 'false'
permissions:
Expand All @@ -43,9 +43,10 @@ jobs:
env:
FLEDGE_GHA_CI: true
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true

- name: Configure Git identity
run: |
Expand All @@ -61,7 +62,6 @@ jobs:

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

- uses: r-lib/actions/setup-r-dependencies@v2
Expand All @@ -72,8 +72,18 @@ jobs:
packages: cynkra/fledge
cache-version: fledge-1

- name: Count rulesets
# Assume that branch is protected if ruleset exists
id: rulesets
env:
GH_TOKEN: ${{ github.token }}
run: |
n_rulesets=$(gh api repos/${{ github.repository }}/rulesets -q length)
echo "count=${n_rulesets}" >> $GITHUB_OUTPUT
shell: bash

- name: Switch to branch if branch protection is enabled
if: github.ref_protected == 'true' || inputs.pr == 'true'
if: github.ref_protected == 'true' || inputs.pr == 'true' || steps.rulesets.outputs.count > 0
run: |
git checkout -b fledge
git push -f -u origin HEAD
Expand All @@ -83,21 +93,25 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |
check_default_branch <- ("${{ github.ref_protected == 'true' || inputs.pr == 'true' }}" != "true")
check_default_branch <- ("${{ github.ref_protected == 'true' || inputs.pr == 'true' || steps.rulesets.outputs.count > 0 }}" != "true")
if (fledge::bump_version(which = "dev", no_change_behavior = "noop", check_default_branch = check_default_branch)) {
fledge::finalize_version(push = TRUE)
}
shell: Rscript {0}

- name: Create and merge PR if branch protection is enabled
if: github.ref_protected == 'true' || inputs.pr == 'true'
if: github.ref_protected == 'true' || inputs.pr == 'true' || steps.rulesets.outputs.count > 0
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -x
gh pr create --base main --head fledge --fill-first
gh workflow run rcc -f ref=$(git rev-parse HEAD)
gh pr merge --merge --auto
set -ex
if [ -n "$(git diff main --numstat)" ]; then
gh pr create --base main --head fledge --fill-first
gh workflow run rcc -f ref=$(git rev-parse HEAD)
gh pr merge --squash --auto
else
echo "No changes."
fi
shell: bash

- name: Check release
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ runs:
echo "_R_CHECK_UNDOC_USE_ALL_NAMES_=true" | tee -a $GITHUB_ENV
echo "_R_CHECK_URLS_SHOW_301_STATUS_=true" | tee -a $GITHUB_ENV
echo "_R_CXX_USE_NO_REMAP_=true" | tee -a $GITHUB_ENV
# There is no way to disable recency and frequency checks when the incoming checks are run
# echo "_R_CHECK_CRAN_INCOMING_=true" | tee -a $GITHUB_ENV
echo "_R_CHECK_CRAN_INCOMING_SKIP_LARGE_VERSION_=true" | tee -a $GITHUB_ENV
shell: bash

- name: Set environment variables (non-Windows only)
Expand All @@ -72,6 +75,12 @@ runs:
echo "_R_CHECK_CRAN_INCOMING_USE_ASPELL_=true" | tee -a $GITHUB_ENV
shell: bash

- name: Remove [email protected]
if: runner.os == 'macOS'
run: |
brew uninstall [email protected] || true
shell: bash

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
Expand All @@ -92,7 +101,7 @@ runs:
env:
GITHUB_PAT: ${{ inputs.token }}
with:
pak-version: devel
pak-version: stable
needs: ${{ inputs.needs }}
packages: ${{ inputs.packages }}
extra-packages: ${{ inputs.extra-packages }} ${{ ( matrix.config.covr && 'any::covr' ) || '' }} ${{ steps.get-extra.outputs.packages }}
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
name: "Lock threads"

permissions:
issues: write
pull-requests: write
discussions: write
on:
workflow_dispatch:
schedule:
- cron: "37 2 * * *"

jobs:
lock:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: dessant/lock-threads@v5
- uses: krlmlr/lock-threads@patch-1
with:
github-token: ${{ github.token }}
issue-inactive-days: "365"
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ concurrency:

jobs:
pkgdown:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

name: "pkgdown"

Expand All @@ -39,10 +39,9 @@ jobs:
- uses: ./.github/workflows/install
with:
token: ${{ secrets.GITHUB_TOKEN }}
install-r: false
cache-version: pkgdown-2
needs: website
extra-packages: r-lib/pkgdown@f-readme-tweak local::.
extra-packages: r-lib/pkgdown local::.

- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/pr-commands.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@v2
with:
install-r: false
- name: Configure Git identity
run: |
env | sort
Expand Down Expand Up @@ -55,8 +53,6 @@ jobs:
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: r-lib/actions/setup-r@v2
with:
install-r: false
- name: Configure Git identity
run: |
env | sort
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.2
RoxygenNote: 7.3.2.9000

0 comments on commit 68f5e97

Please sign in to comment.