Skip to content

Upload build binaries #708

Upload build binaries

Upload build binaries #708

Workflow file for this run

---
# Github Actions workflow to check and build StanHeaders and RStan
# yamllint disable rule:line-length
name: R-CMD-check
'on':
push:
branches:
- develop
- experimental
- StanHeaders_*
- workflow-check
pull_request:
branches:
- develop
- experimental
- StanHeaders_*
jobs:
R-CMD-check:
if: "! contains(github.event.head_commit.message, '[ci skip]')"
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
fail-fast: true
matrix:
config:
- {os: macOS-latest, r: 'devel'}
- {os: macOS-latest, r: 'release'}
- {os: macOS-latest, r: 'oldrel'}
- {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: 'oldrel'}
- {os: ubuntu-latest, r: 'devel'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel'}
env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
- uses: r-lib/actions/setup-pandoc@v2
# Use a shorter temp directory for pak installations, due to filename
# length issues on Windows. https://github.com/r-lib/pak/issues/252
- name: Windows temp dir
if: runner.os == 'Windows'
run: |
New-Item -Path "C:\" -Name "tmp" -ItemType Directory
echo "TMPDIR=c:\tmp" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- uses: r-lib/actions/setup-r-dependencies@v2
with:
working-directory: rstan/rstan
extra-packages: any::rcmdcheck, local::../../StanHeaders
- name: Remove symlinks on Windows
if: runner.os == 'Windows'
run: |
rm -Rf inst/include/src \
inst/include/mathlib \
inst/include/stan \
inst/include/libsundials || true
shell: bash
- uses: r-lib/actions/check-r-package@v2
with:
working-directory: StanHeaders
upload-snapshots: true
upload-results: true
env:
_R_CHECK_CRAN_INCOMING_: false
- uses: r-lib/actions/check-r-package@v2
with:
working-directory: rstan/rstan
upload-snapshots: true
upload-results: true
env:
_R_CHECK_CRAN_INCOMING_: false
- name: Build binary packages
run: |
bin1 <- pkgbuild::build("./StanHeaders", dest_path = tempdir(), vignettes = FALSE, manual = FALSE, binary = TRUE)
bin2 <- pkgbuild::build("./rstan/rstan", dest_path = tempdir(), vignettes = FALSE, manual = FALSE, binary = TRUE)
dir.create("build_bin")
file.copy(c(bin1, bin2), "build_bin")
shell: Rscript {0}
- name: Build source packages
if: matrix.config.os == 'ubuntu-latest' && matrix.config.r == 'devel'
run: |
src1 <- pkgbuild::build("./StanHeaders", dest_path = tempdir(), vignettes = FALSE, manual = FALSE, binary = FALSE)
src2 <- pkgbuild::build("./rstan/rstan", dest_path = tempdir(), vignettes = FALSE, manual = FALSE, binary = FALSE)
dir.create("build_src")
file.copy(c(src1, src2), "build_src")
shell: Rscript {0}
- name: Upload source packages
if: matrix.config.os == 'ubuntu-latest' && matrix.config.r == 'devel'
uses: actions/upload-artifact@v2
with:
path: build_src
- name: Upload binary packages
uses: actions/upload-artifact@v2
with:
name: R-${{ matrix.config.r }}_${{ matrix.config.os }}
path: build_bin