Skip to content

Commit 97304e0

Browse files
authored
ci: Use stable pak (#17)
* 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
1 parent 35edb0b commit 97304e0

8 files changed

Lines changed: 34 additions & 25 deletions

File tree

.github/workflows/R-CMD-check-dev.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ jobs:
2727
token: ${{ secrets.GITHUB_TOKEN }}
2828

2929
- uses: r-lib/actions/setup-r@v2
30-
with:
31-
install-r: false
3230

3331
- id: set-matrix
3432
uses: ./.github/workflows/dep-matrix
@@ -70,7 +68,6 @@ jobs:
7068

7169
- uses: ./.github/workflows/install
7270
with:
73-
install-r: false
7471
cache-version: rcc-dev-base-1
7572
needs: check
7673
extra-packages: "any::rcmdcheck any::remotes ."
@@ -118,7 +115,6 @@ jobs:
118115

119116
- uses: ./.github/workflows/install
120117
with:
121-
install-r: false
122118
cache-version: rcc-dev-${{ matrix.package }}-1
123119
needs: check
124120
extra-packages: "any::rcmdcheck any::remotes ."

.github/workflows/R-CMD-check-status.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ name: rcc-status
1212

1313
jobs:
1414
rcc-status:
15-
runs-on: ubuntu-latest
15+
runs-on: ubuntu-24.04
1616

1717
name: "Update commit status"
1818

.github/workflows/R-CMD-check.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ name: rcc
4343

4444
jobs:
4545
rcc-smoke:
46-
runs-on: ubuntu-latest
46+
runs-on: ubuntu-24.04
4747
outputs:
4848
sha: ${{ steps.commit.outputs.sha }}
4949
versions-matrix: ${{ steps.versions-matrix.outputs.matrix }}
@@ -205,7 +205,7 @@ jobs:
205205
shell: bash
206206

207207
rcc-smoke-check-matrix:
208-
runs-on: ubuntu-latest
208+
runs-on: ubuntu-24.04
209209

210210
name: "Check matrix"
211211

@@ -294,7 +294,6 @@ jobs:
294294

295295
- uses: ./.github/workflows/install
296296
with:
297-
install-r: false
298297
cache-version: rcc-dev-${{ matrix.package }}-1
299298
needs: check
300299
extra-packages: "any::rcmdcheck any::remotes ."

.github/workflows/fledge.yaml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919

2020
jobs:
2121
check_fork:
22-
runs-on: ubuntu-latest
22+
runs-on: ubuntu-24.04
2323
outputs:
2424
is_forked: ${{ steps.check.outputs.is_forked }}
2525
steps:
@@ -33,7 +33,7 @@ jobs:
3333
shell: bash
3434

3535
fledge:
36-
runs-on: ubuntu-latest
36+
runs-on: ubuntu-24.04
3737
needs: check_fork
3838
if: needs.check_fork.outputs.is_forked == 'false'
3939
permissions:
@@ -61,7 +61,6 @@ jobs:
6161

6262
- uses: r-lib/actions/setup-r@v2
6363
with:
64-
install-r: false
6564
use-public-rspm: true
6665

6766
- uses: r-lib/actions/setup-r-dependencies@v2
@@ -72,8 +71,18 @@ jobs:
7271
packages: cynkra/fledge
7372
cache-version: fledge-1
7473

74+
- name: Count rulesets
75+
# Assume that branch is protected if ruleset exists
76+
id: rulesets
77+
env:
78+
GH_TOKEN: ${{ github.token }}
79+
run: |
80+
n_rulesets=$(gh api repos/${{ github.repository }}/rulesets -q length)
81+
echo "count=${n_rulesets}" >> $GITHUB_OUTPUT
82+
shell: bash
83+
7584
- name: Switch to branch if branch protection is enabled
76-
if: github.ref_protected == 'true' || inputs.pr == 'true'
85+
if: github.ref_protected == 'true' || inputs.pr == 'true' || steps.rulesets.outputs.count > 0
7786
run: |
7887
git checkout -b fledge
7988
git push -f -u origin HEAD
@@ -83,21 +92,21 @@ jobs:
8392
env:
8493
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
8594
run: |
86-
check_default_branch <- ("${{ github.ref_protected == 'true' || inputs.pr == 'true' }}" != "true")
95+
check_default_branch <- ("${{ github.ref_protected == 'true' || inputs.pr == 'true' || steps.rulesets.outputs.count > 0 }}" != "true")
8796
if (fledge::bump_version(which = "dev", no_change_behavior = "noop", check_default_branch = check_default_branch)) {
8897
fledge::finalize_version(push = TRUE)
8998
}
9099
shell: Rscript {0}
91100

92101
- name: Create and merge PR if branch protection is enabled
93-
if: github.ref_protected == 'true' || inputs.pr == 'true'
102+
if: github.ref_protected == 'true' || inputs.pr == 'true' || steps.rulesets.outputs.count > 0
94103
env:
95104
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96105
run: |
97106
set -x
98107
gh pr create --base main --head fledge --fill-first
99108
gh workflow run rcc -f ref=$(git rev-parse HEAD)
100-
gh pr merge --merge --auto
109+
gh pr merge --squash --auto
101110
shell: bash
102111

103112
- name: Check release

.github/workflows/install/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ runs:
7575
echo "_R_CHECK_CRAN_INCOMING_USE_ASPELL_=true" | tee -a $GITHUB_ENV
7676
shell: bash
7777

78+
- name: Remove pkg-config@0.29.2
79+
if: runner.os == 'macOS'
80+
run: |
81+
brew uninstall pkg-config@0.29.2 || true
82+
shell: bash
83+
7884
- uses: r-lib/actions/setup-pandoc@v2
7985

8086
- uses: r-lib/actions/setup-r@v2
@@ -95,7 +101,7 @@ runs:
95101
env:
96102
GITHUB_PAT: ${{ inputs.token }}
97103
with:
98-
pak-version: devel
104+
pak-version: stable
99105
needs: ${{ inputs.needs }}
100106
packages: ${{ inputs.packages }}
101107
extra-packages: ${{ inputs.extra-packages }} ${{ ( matrix.config.covr && 'any::covr' ) || '' }} ${{ steps.get-extra.outputs.packages }}

.github/workflows/lock.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
name: "Lock threads"
2-
2+
permissions:
3+
issues: write
4+
pull-requests: write
5+
discussions: write
36
on:
7+
workflow_dispatch:
48
schedule:
59
- cron: "37 2 * * *"
610

711
jobs:
812
lock:
9-
runs-on: ubuntu-latest
13+
runs-on: ubuntu-24.04
1014
steps:
11-
- uses: dessant/lock-threads@v5
15+
- uses: krlmlr/lock-threads@patch-1
1216
with:
1317
github-token: ${{ github.token }}
1418
issue-inactive-days: "365"

.github/workflows/pkgdown.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ concurrency:
1616

1717
jobs:
1818
pkgdown:
19-
runs-on: ubuntu-latest
19+
runs-on: ubuntu-24.04
2020

2121
name: "pkgdown"
2222

@@ -39,7 +39,6 @@ jobs:
3939
- uses: ./.github/workflows/install
4040
with:
4141
token: ${{ secrets.GITHUB_TOKEN }}
42-
install-r: false
4342
cache-version: pkgdown-2
4443
needs: website
4544
extra-packages: r-lib/pkgdown local::.

.github/workflows/pr-commands.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ jobs:
1616
with:
1717
repo-token: ${{ secrets.GITHUB_TOKEN }}
1818
- uses: r-lib/actions/setup-r@v2
19-
with:
20-
install-r: false
2119
- name: Configure Git identity
2220
run: |
2321
env | sort
@@ -55,8 +53,6 @@ jobs:
5553
with:
5654
repo-token: ${{ secrets.GITHUB_TOKEN }}
5755
- uses: r-lib/actions/setup-r@v2
58-
with:
59-
install-r: false
6056
- name: Configure Git identity
6157
run: |
6258
env | sort

0 commit comments

Comments
 (0)