Skip to content

Create install-test.yml #3

Create install-test.yml

Create install-test.yml #3

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
#
# See https://github.com/r-lib/actions/tree/master/examples#readme for
# additional example workflows available for the R community.
name: R
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
r-version: [4.3, 4.4]
install-method: ["devtools::install_github", "install.packages", "remotes::install_url"]
steps:
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}
- name: Install devtools and remotes (if needed)
run: |
if [ "${{ matrix.install-method }}" == "devtools::install_github" ]; then
R -e 'if (!requireNamespace("devtools", quietly = TRUE)) install.packages("devtools")'
elif [ "${{ matrix.install-method }}" == "remotes::install_url" ]; then
R -e 'if (!requireNamespace("remotes", quietly = TRUE)) install.packages("remotes")'
fi
- name: Install Package - ${{ matrix.install-method }}
run: |
if [ "${{ matrix.install-method }}" == "devtools::install_github" ]; then
R -e 'devtools::install_github("USEPA/EJAM-open")'
elif [ "${{ matrix.install-method }}" == "install.packages" ]; then
R -e 'install.packages("https://github.com/USEPA/EJAM-open/archive/refs/tags/v2.32-EJAM-open.tar.gz", repos = NULL, type = "source")'
elif [ "${{ matrix.install-method }}" == "remotes::install_url" ]; then
R -e 'remotes::install_url("https://github.com/USEPA/EJAM-open/archive/main.tar.gz")'
fi
- name: Test Installation
run: |
R -e 'library(EJAM); print("Package loaded successfully")'