-
-
Notifications
You must be signed in to change notification settings - Fork 7
77 lines (65 loc) · 1.97 KB
/
send-test.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
68
69
70
71
72
73
74
75
76
77
on:
schedule:
- cron: "0 0 1 * *"
push:
branches:
- main
- master
name: send-test
jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
name: ${{ matrix.config.os }} (${{ matrix.config.r }})
strategy:
matrix:
config:
- {os: macOS-latest, r: 'release'}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
SENDGRID_API: ${{ secrets.SENDGRID_API }}
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
extra-packages: cachem
- name: Install package
run: R CMD INSTALL .
- name: Check Base
run: |
keyring::key_set_with_value(service = "apikey",
username = "sendgridr",
password = Sys.getenv("SENDGRID_API"))
library(sendgridr)
mail() |>
from("[email protected]") |>
to("[email protected]") |>
subject("sendgridr package weekly send test") |>
body("body is ok") |>
attachments("man/figures/logo.png") |>
send() -> chk
print(chk)
if (!is.null(chk$errors)) {
stop("send fail!")
}
shell: Rscript {0}
- name: Check Rmd Render
run: |
library(sendgridr)
path <- system.file("extdata", "test.Rmd", package = "sendgridr")
mail() |>
from("[email protected]") |>
to("[email protected]") |>
subject("sendgridr package weekly send test") |>
embed_rmd(path) |>
send() -> chk
print(chk)
if (!is.null(chk$errors)) {
stop("send fail!")
}
shell: Rscript {0}