Skip to content

Commit

Permalink
ci: Use stable pak (#17)
Browse files Browse the repository at this point in the history
* ci: Use stable pak

* ci: Correctly detect branch protection

* ci: Use Ubuntu 24.04 and styler PR

* ci: Use Ubuntu 24.04 for fledge, squash

* ci: Fix macOS (#16)

* ci: Need to install R on Ubuntu 24.04

* ci: Need to install R on Ubuntu 24.04 for fledge

* ci: Use styler from main branch

* ci: Explicit permissions

* ci: Ignore errors when removing pkg-config on macOS

* ci: Use larger retry count for lock-threads workflow
  • Loading branch information
krlmlr authored Dec 6, 2024
1 parent 35edb0b commit 97304e0
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 25 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
5 changes: 2 additions & 3 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 @@ -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 @@ -294,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
23 changes: 16 additions & 7 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 Down Expand Up @@ -61,7 +61,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 +71,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 +92,21 @@ 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
gh pr merge --squash --auto
shell: bash

- name: Check release
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,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 @@ -95,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
3 changes: 1 addition & 2 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,7 +39,6 @@ jobs:
- uses: ./.github/workflows/install
with:
token: ${{ secrets.GITHUB_TOKEN }}
install-r: false
cache-version: pkgdown-2
needs: website
extra-packages: r-lib/pkgdown local::.
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

0 comments on commit 97304e0

Please sign in to comment.