-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (54 loc) · 1.48 KB
/
flepicommon-ci.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
name: flepicommon-ci
on:
workflow_dispatch:
push:
paths:
- flepimop/R_packages/flepicommon/**/*
branches:
- main
- dev
pull_request:
paths:
- flepimop/R_packages/flepicommon/**/*
branches:
- main
- dev
jobs:
ci:
runs-on: ubuntu-latest
strategy:
matrix:
R-version: ["4.3.3"]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
lfs: true
- name: Install R
run: |
UBUNTU_VERSION=$( echo "$( lsb_release -r )" | awk '{print $2}' | sed 's/\.//g' )
curl -O https://cdn.rstudio.com/r/ubuntu-${UBUNTU_VERSION}/pkgs/r-${R_VERSION}_1_amd64.deb
sudo apt-get update
sudo apt-get install ./r-${R_VERSION}_1_amd64.deb
R --version
shell: bash
env:
R_VERSION: ${{ matrix.R-version }}
- name: Build flepicommon
run: |
R CMD build flepimop/R_packages/flepicommon/
shell: bash
- name: Install Dependencies And flepicommon
run: |
files <- list.files()
pkg <- files[startsWith(files, "flepicommon_")]
install.packages(pkg, dependencies = TRUE)
install.packages("devtools")
packageVersion("flepicommon")
shell: Rscript {0}
- name: Run Unit Tests
run: |
setwd("flepimop/R_packages/flepicommon")
library(devtools)
devtools::test(stop_on_failure = TRUE)
shell: Rscript {0}