Skip to content

bugfix: R CI

bugfix: R CI #646

name: Build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build-and-test-python:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.10"]
os: ["macos-13", "ubuntu-latest", "windows-latest", "macos-latest-xlarge"]
fail-fast: false
steps:
- name: "Set environment variables (Windows)"
if: startsWith(runner.os, 'Windows')
shell: pwsh
run: |
(Get-ItemProperty "HKLM:System\CurrentControlSet\Control\FileSystem").LongPathsEnabled
$os_version = (Get-CimInstance Win32_OperatingSystem).version
Echo "OS_VERSION=$os_version" >> $env:GITHUB_ENV
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: "**/python/pyproject.toml"
- name: "Restore RTools40"
if: startsWith(runner.os, 'Windows')
id: cache-rtools
uses: actions/cache@v4
with:
path: C:/rtools40
key: ${{ runner.os }}-${{ env.OS_VERSION }}-rtools-v1
- name: Install and test
run: |
cd python
python -m pip install -U --editable ".[dev,parallel]"
python -m pytest prophet/tests/
build-and-test-r:
runs-on: ${{ matrix.config.os }}
name: R ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
matrix:
config:
- {os: ubuntu-22.04, r: 'release', rspm: "https://packagemanager.example.com/our-cran/__linux__/jammy/latest"}
fail-fast: false
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
R_KEEP_PKG_SOURCE: yes
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
PKGDIR: "R/"
steps:
- uses: actions/checkout@v4
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
any::rcmdcheck
any::knitr
any::testthat
any::readr
any::rmarkdown
needs: check
working-directory: ${{ env.PKGDIR }}
# Install Stan packages if needed
- name: Install Stan packages
run: |
install.packages(c("cmdstanr", "posterior"), repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
shell: Rscript {0}
working-directory: ${{ env.PKGDIR }}
- uses: r-lib/actions/check-r-package@v2
with:
upload-snapshots: true
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'
working-directory: ${{ env.PKGDIR }}