Update zzz.R #966
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: flaiR-Ubuntu | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
test-installation: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
r-version: ['4.1.3', '4.2.3', '4.3.2'] | |
python-version: ['3.10'] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y \ | |
libcurl4-openssl-dev \ | |
libssl-dev \ | |
libxml2-dev \ | |
libpng-dev \ | |
libtiff5-dev \ | |
libjpeg-dev \ | |
libharfbuzz-dev \ | |
libfribidi-dev \ | |
libfreetype6-dev | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Verify Python | |
run: | | |
python --version | |
which python | |
- uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.r-version }} | |
- name: Setup R package dependencies cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: ${{ runner.os }}-r-${{ matrix.r-version }}-${{ hashFiles('**/DESCRIPTION') }} | |
restore-keys: ${{ runner.os }}-r- | |
- name: Install R dependencies | |
run: | | |
Rscript -e ' | |
install.packages(c("pak", "remotes", "reticulate", "renv"), repos="https://cloud.r-project.org") | |
pak::pkg_install("r-lib/pak") | |
pak::local_install_deps(upgrade = TRUE) | |
reticulate::py_config() | |
' | |
- name: Install flaiR | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
Rscript -e ' | |
Sys.setenv(GITHUB_PAT = Sys.getenv("GITHUB_PAT")) | |
tryCatch({ | |
remotes::install_github("davidycliao/flaiR", force = TRUE) | |
library(flaiR) | |
cat("flaiR installed and loaded successfully\n") | |
}, error = function(e) { | |
cat("Error during installation or loading:", conditionMessage(e), "\n") | |
quit(status = 1) | |
})' | |
- name: Print environment info | |
if: always() | |
run: | | |
python --version | |
R --version | |
Rscript -e 'reticulate::py_config()' |