Skip to content

Commit a336116

Browse files
authored
ci: Use workflows for fledge (#62)
* ci: Use workflows for fledge * ci: Review env vers when installing, more careful foreign runs, format with `clang-format`
1 parent 85d1279 commit a336116

File tree

4 files changed

+28
-21
lines changed

4 files changed

+28
-21
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
ref: ${{ inputs.ref }}
7777

7878
- name: Update status for rcc
79-
if: github.actor != 'Copilot'
79+
if: github.actor != 'Copilot' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
8080
# FIXME: Wrap into action
8181
env:
8282
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -121,7 +121,7 @@ jobs:
121121
cache-version: rcc-smoke-2
122122
needs: build, check, website
123123
# Beware of using dev pkgdown here, has brought in dev dependencies in the past
124-
extra-packages: any::rcmdcheck r-lib/roxygen2 any::decor r-lib/styler r-lib/pkgdown deps::.
124+
extra-packages: any::rcmdcheck r-lib/roxygen2 any::decor r-lib/pkgdown deps::.
125125

126126
- uses: ./.github/workflows/custom/after-install
127127
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''
@@ -182,7 +182,7 @@ jobs:
182182

183183
- name: Update status for rcc
184184
# FIXME: Wrap into action
185-
if: always() && (github.actor != 'Copilot')
185+
if: always() && (github.actor != 'Copilot') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository)
186186
env:
187187
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188188
run: |

.github/workflows/fledge.yaml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,14 @@ jobs:
4848
fetch-depth: 0
4949
fetch-tags: true
5050

51-
- name: Configure Git identity
52-
run: |
53-
env | sort
54-
git config --local user.name "$GITHUB_ACTOR"
55-
git config --local user.email "[email protected]"
56-
shell: bash
51+
- uses: ./.github/workflows/git-identity
5752

5853
- name: Update apt
5954
run: |
6055
sudo apt-get update
6156
shell: bash
6257

63-
- uses: r-lib/actions/setup-r@v2
64-
with:
65-
use-public-rspm: true
66-
67-
- uses: r-lib/actions/setup-r-dependencies@v2
68-
env:
69-
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
58+
- uses: ./.github/workflows/install
7059
with:
7160
pak-version: devel
7261
packages: cynkra/fledge

.github/workflows/install/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ runs:
7474
echo "_R_CHECK_BASHISMS_=true" | tee -a $GITHUB_ENV
7575
shell: bash
7676

77+
- name: Review environment variables
78+
run: |
79+
set -x
80+
env | sort
81+
shell: bash
82+
7783
- name: Update apt
7884
if: runner.os == 'Linux'
7985
run: |

.github/workflows/style/action.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,36 @@ runs:
88
run: |
99
set -x
1010
if [ -f air.toml ]; then
11-
echo enabled=true >> $GITHUB_OUTPUT
11+
echo air_enabled=true >> $GITHUB_OUTPUT
1212
else
13-
echo enabled=false >> $GITHUB_OUTPUT
13+
echo air_enabled=false >> $GITHUB_OUTPUT
14+
fi
15+
if [ -f .clang-format ]; then
16+
echo clang_format_enabled=true >> $GITHUB_OUTPUT
17+
else
18+
echo clang_format_enabled=false >> $GITHUB_OUTPUT
1419
fi
1520
shell: bash
1621

1722
- name: Install air
18-
if: ${{ steps.check.outputs.enabled == 'true' }}
23+
if: ${{ steps.check.outputs.air_enabled == 'true' }}
1924
uses: posit-dev/setup-air@v1
2025

2126
- name: Run air
22-
if: ${{ steps.check.outputs.enabled == 'true' }}
27+
if: ${{ steps.check.outputs.air_enabled == 'true' }}
2328
run: |
2429
air format .
2530
shell: bash
2631

32+
- name: Run clang-format
33+
if: ${{ steps.check.outputs.clang_format_enabled == 'true' }}
34+
run: |
35+
shopt -s nullglob
36+
clang-format -i src/*.{c,cc,cpp,h,hpp}
37+
shell: bash
38+
2739
- name: Check Git status
28-
if: ${{ steps.check.outputs.enabled == 'true' }}
40+
if: ${{ steps.check.outputs.air_enabled == 'true' || steps.check.outputs.clang_format_enabled == 'true' }}
2941
run: |
3042
git status
3143
shell: bash

0 commit comments

Comments
 (0)