forked from carpentries-incubator/r-geospatial-urban
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (56 loc) · 2.03 KB
/
workshop-setup.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
57
58
59
# A workflow for testing the workshop setup in different operating systems
name: Test Workshop Setup
# Controls when the action will run. Workflow runs when manually triggered using the UI
on:
workflow_dispatch:
jobs:
workshop_setup:
runs-on: ${{matrix.os}}
strategy:
matrix:
# list of Os's
R: ['4.3.3']
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: ${{matrix.R}}
rtools-version: '43'
- run: Rscript -e 'print("R was installed successfully")'
- name: Install GDAL, GEOS, and PROJ.4 (macOS)
if: matrix.os == 'macos-latest'
run: |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
brew tap osgeo/osgeo4mac && brew tap --repair
brew install proj
brew install geos
brew install gdal
shell: bash
- name: Install GDAL, GEOS, and PROJ.4 (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
sudo add-apt-repository ppa:ubuntugis -y
sudo apt-get update
sudo apt-get install libgdal-dev libgeos-dev libproj-dev -y
shell: bash
# Include Fedora and Arch?
- name: UDUNITS
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install libudunits2-dev -y
shell: bash
- name: Geospatial Packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
packages: |
any::sessioninfo
any::tidyverse
any::terra
any::sf
- name: Test Lessons
run: |
Rscript -e 'nc <- sf::st_read(system.file("shape/nc.shp", package="sf"), quiet = TRUE); if (sf::st_crs(sf::st_transform(nc, 4326))$epsg == 4326) print("`sf` works as expected"); if (nrow(dplyr::filter(nc, AREA > 0.2)) == 11) print("`tidyverse` works as expected")'