-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 2 KB
/
install-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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")'