-
Notifications
You must be signed in to change notification settings - Fork 2
67 lines (65 loc) · 2.28 KB
/
main.yaml
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
60
61
62
63
64
65
66
67
name: main
on:
push:
pull_request:
types: [assigned, opened, synchronize, reopened]
release:
types: [published, created, edited]
jobs:
cicd:
runs-on: ubuntu-18.04
container:
image: rocker/rstudio:latest # needs to be the same as in dockerfile
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Query dependencies
run: |
options(warn = 2)
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds", version = 2)
shell: Rscript {0}
- name: Cache R packages
uses: actions/cache@v1
with:
path: /usr/local/lib/R/site-library
key: rocker-rstudio-latest-${{ hashFiles('depends.Rds') }}
restore-keys: rocker-rstudio-latest-
- name: Install system dependencies
env:
RHUB_PLATFORM: linux-x86_64-debian-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs', ref='3860f2b512a9c3bd3db6791c2ff467a1158f4048')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}
- name: Check package
run: rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "warning", check_dir = "check")
shell: Rscript {0}
- name: Upload check results
if: failure()
uses: actions/upload-artifact@v1
with:
name: results
path: check
- name: Run Code Coverage
run: covr::codecov(commit = '$GITHUB_SHA', branch = '$GITHUB_REF', token = '${{ secrets.CODECOV_TOKEN }}')
shell: Rscript {0}
- name: Copy dependencies to working directory
run: |
cp --recursive --force /usr/local/lib/R/site-library/* deps/
- name: Build pkgdown website
run: pkgdown::build_site()
shell: Rscript {0}
- name: Deploy to GitHub Pages
if: github.ref == 'refs/heads/master'
uses: maxheld83/ghpages@github-token
env:
BUILD_DIR: docs
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}