-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
61 lines (55 loc) · 1.82 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
61 lines (55 loc) · 1.82 KB
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
variables:
_R_CHECK_CRAN_INCOMING_: "false"
_R_CHECK_FORCE_SUGGESTS_: "true"
_R_CHECK_DONTTEST_EXAMPLES_: "false"
_R_CHECK_RD_XREFS_: "false"
stages:
- check
- build
- verify
workflow:
rules:
- if: $CI_COMMIT_BRANCH =~ /^rc\//
.r-base:
tags:
- chs-shared
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/rocker/geospatial:latest
before_script:
- wget --no-check-certificate -O /usr/local/share/ca-certificates/DOIRootCA2.crt https://raw.githubusercontent.com/dblodgett-usgs/hydrogeoenv/master/linux/DOIRootCA2.cer
- chmod 644 /usr/local/share/ca-certificates/DOIRootCA2.crt && update-ca-certificates
- apt-get update
- apt-get install -y --no-install-recommends p7zip-full qpdf pandoc curl
- export PATH="/usr/local/lib/R/site-library/littler/examples/:${PATH}"
- echo "options(Ncpus = $(nproc --all))" >> /usr/local/lib/R/etc/Rprofile.site
- r -e 'pak::local_install_dev_deps()'
check:
extends: .r-base
stage: check
script:
- R CMD build --no-build-vignettes --no-manual .
- R CMD check --no-tests --no-examples --no-vignettes --no-manual *.tar.gz
artifacts:
paths:
- "*.Rcheck"
when: always
build:
extends: .r-base
stage: build
script:
- R CMD build .
- PKG_FILE=$(ls *.tar.gz)
- PKG_NAME=$(echo "$PKG_FILE" | sed 's/_.*//')
- PKG_VERSION=$(echo "$PKG_FILE" | sed 's/.*_\(.*\)\.tar\.gz/\1/')
- 'curl --silent --show-error --write-out "\nHTTP status: %{http_code}\n" --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "$PKG_FILE" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PKG_NAME}/${PKG_VERSION}/${PKG_FILE}"'
artifacts:
paths:
- "*.tar.gz"
verify:
extends: .r-base
stage: verify
script:
- R CMD check --as-cran --no-manual *.tar.gz
artifacts:
paths:
- "*.Rcheck"
when: always