Skip to content

Commit

Permalink
ci: Change Makevars only after installation of R
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Nov 30, 2024
1 parent 7e28378 commit e22288d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,15 @@ jobs:
# 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::.

- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''

# Must come after the custom after-install workflow
- name: Install package
run: |
_R_SHLIB_STRIP_=true R CMD INSTALL .
shell: bash

- uses: ./.github/workflows/custom/after-install
if: hashFiles('.github/workflows/custom/after-install/action.yml') != ''

- id: versions-matrix
# Only run for pull requests if the base repo is different from the head repo, not for workflow_dispatch if not requested, always run for other events
if: (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository) && (github.event_name != 'workflow_dispatch' || inputs.versions-matrix)
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/custom/after-install/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: 'Custom steps to run after R packages are installed'

runs:
using: "composite"
steps:
- name: Use GLPK on macOS
if: runner.os == 'macOS'
run: |
echo -e 'CPPFLAGS = -I/opt/homebrew/include\nLDFLAGS = -L/opt/homebrew/lib' | tee ~/.R/Makevars
shell: bash
3 changes: 1 addition & 2 deletions .github/workflows/custom/before-install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ runs:
echo '_R_CHECK_PKG_SIZES_=FALSE' | tee -a $GITHUB_ENV
shell: bash

- name: Install and use GLPK on macOS
- name: Install GLPK on macOS
if: runner.os == 'macOS'
run: |
brew install glpk
echo -e 'CPPFLAGS = -I/opt/homebrew/include\nLDFLAGS = -L/opt/homebrew/lib' | tee ~/.R/Makevars
shell: bash

0 comments on commit e22288d

Please sign in to comment.