Skip to content

getting TAR URL via curl #15

getting TAR URL via curl

getting TAR URL via curl #15

name: EJAM Installation
on:
push:
branches: [ "main", "test" ]
pull_request:
branches: [ "main", "test" ]
permissions:
contents: read
jobs:
install_ejam:
if: ${{ !github.event.repository.private }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
r-version: [4.3, 4.4]
install-method: [github, url] # Matrix for installation method
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.r-version }}
- name: Restore R package cache
uses: actions/cache@v4
with:
path: ${{ runner.temp }}
key: ${{ runner.os }}-R-${{ matrix.r-version }}-${{ hashFiles('**/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-R-${{ matrix.r-version }}-
- name: System Libraries
if: runner.os != 'Windows'
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
sudo apt-get update
sudo apt-get install -y libfontconfig1-dev libudunits2-dev libcairo2-dev libcurl4-openssl-dev \
libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev \
libjpeg-dev libgdal-dev libgeos-dev libproj-dev
elif [ "${{ matrix.os }}" == "macOS-latest" ]; then
brew install freetype udunits cairo harfbuzz fribidi libpng libtiff jpeg gdal pkg-config
fi
- name: Get latest tar.gz URL
if: matrix.install-method == 'url'
run: |
TAR_URL=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq -r '.tarball_url')
echo "TAR_URL=$TAR_URL" >> $GITHUB_ENV
- name: Install EJAM (method- ${{ matrix.install-method }})
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
run: |

Check failure on line 60 in .github/workflows/installation_test.yml

View workflow run for this annotation

GitHub Actions / EJAM Installation

Invalid workflow file

The workflow is not valid. .github/workflows/installation_test.yml (Line: 60, Col: 14): Unrecognized named-value: 'TAR_URL'. Located at position 1 within expression: TAR_URL
install.packages("remotes")
if("${{ matrix.install-method }}" == "github") {
remotes::install_github(
"${{ github.repository }}", # what owner/repo has the pkg to try to install
dependencies=TRUE,
force=TRUE,
INSTALL_opts = c("--with-keep.source", "--install-tests")
)
} else {
remotes::install_url(
url = ${{ TAR_URL }},
#url = "https://github.com/USEPA/EJAM-open/archive/refs/tags/v2.32.1.tar.gz",
dependencies = TRUE,
auth_token = ""
)
}
shell: Rscript {0}
- name: Restore R package cache
uses: actions/cache@v4
with:
path: ${{ runner.temp }}
key: ${{ runner.os }}-R-${{ matrix.r-version }}-${{ hashFiles('**/DESCRIPTION') }}
restore-keys: ${{ runner.os }}-R-${{ matrix.r-version }}-
- name: Test Installation
run: |
R -e 'library(EJAM); print("Package loaded successfully")'