From 8f156f5fcc7b26e5419b3213a236d4fa0a4ba663 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 9 Nov 2025 15:42:25 +0100 Subject: [PATCH 1/2] ci: Use workflows for fledge --- .github/workflows/fledge.yaml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/fledge.yaml b/.github/workflows/fledge.yaml index 5b2131a..c8d5b14 100644 --- a/.github/workflows/fledge.yaml +++ b/.github/workflows/fledge.yaml @@ -48,25 +48,14 @@ jobs: fetch-depth: 0 fetch-tags: true - - name: Configure Git identity - run: | - env | sort - git config --local user.name "$GITHUB_ACTOR" - git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" - shell: bash + - uses: ./.github/workflows/git-identity - name: Update apt run: | sudo apt-get update shell: bash - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + - uses: ./.github/workflows/install with: pak-version: devel packages: cynkra/fledge From 9d00efd79d6a841f9f21a1109c294f93347cebef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kirill=20M=C3=BCller?= Date: Sun, 9 Nov 2025 15:45:17 +0100 Subject: [PATCH 2/2] ci: Review env vers when installing, more careful foreign runs, format with `clang-format` --- .github/workflows/R-CMD-check.yaml | 6 +++--- .github/workflows/install/action.yml | 6 ++++++ .github/workflows/style/action.yml | 22 +++++++++++++++++----- 3 files changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index b5bccb8..2187e48 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -76,7 +76,7 @@ jobs: ref: ${{ inputs.ref }} - name: Update status for rcc - if: github.actor != 'Copilot' + if: github.actor != 'Copilot' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) # FIXME: Wrap into action env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -121,7 +121,7 @@ jobs: cache-version: rcc-smoke-2 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::. + extra-packages: any::rcmdcheck r-lib/roxygen2 any::decor r-lib/pkgdown deps::. - uses: ./.github/workflows/custom/after-install if: hashFiles('.github/workflows/custom/after-install/action.yml') != '' @@ -182,7 +182,7 @@ jobs: - name: Update status for rcc # FIXME: Wrap into action - if: always() && (github.actor != 'Copilot') + if: always() && (github.actor != 'Copilot') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/.github/workflows/install/action.yml b/.github/workflows/install/action.yml index a0aec0c..13c0076 100644 --- a/.github/workflows/install/action.yml +++ b/.github/workflows/install/action.yml @@ -74,6 +74,12 @@ runs: echo "_R_CHECK_BASHISMS_=true" | tee -a $GITHUB_ENV shell: bash + - name: Review environment variables + run: | + set -x + env | sort + shell: bash + - name: Update apt if: runner.os == 'Linux' run: | diff --git a/.github/workflows/style/action.yml b/.github/workflows/style/action.yml index a5e83a5..fbd9357 100644 --- a/.github/workflows/style/action.yml +++ b/.github/workflows/style/action.yml @@ -8,24 +8,36 @@ runs: run: | set -x if [ -f air.toml ]; then - echo enabled=true >> $GITHUB_OUTPUT + echo air_enabled=true >> $GITHUB_OUTPUT else - echo enabled=false >> $GITHUB_OUTPUT + echo air_enabled=false >> $GITHUB_OUTPUT + fi + if [ -f .clang-format ]; then + echo clang_format_enabled=true >> $GITHUB_OUTPUT + else + echo clang_format_enabled=false >> $GITHUB_OUTPUT fi shell: bash - name: Install air - if: ${{ steps.check.outputs.enabled == 'true' }} + if: ${{ steps.check.outputs.air_enabled == 'true' }} uses: posit-dev/setup-air@v1 - name: Run air - if: ${{ steps.check.outputs.enabled == 'true' }} + if: ${{ steps.check.outputs.air_enabled == 'true' }} run: | air format . shell: bash + - name: Run clang-format + if: ${{ steps.check.outputs.clang_format_enabled == 'true' }} + run: | + shopt -s nullglob + clang-format -i src/*.{c,cc,cpp,h,hpp} + shell: bash + - name: Check Git status - if: ${{ steps.check.outputs.enabled == 'true' }} + if: ${{ steps.check.outputs.air_enabled == 'true' || steps.check.outputs.clang_format_enabled == 'true' }} run: | git status shell: bash