-
Notifications
You must be signed in to change notification settings - Fork 32
64 lines (55 loc) · 1.89 KB
/
utterances-cleanup.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
name: Cleanup comments
on:
repository_dispatch:
# trigger from R via:
# gh::gh("POST /repos/:owner/:repo/dispatches", owner = "Milano-R", repo = "erum2020-covidr-contest", event_type = "cleanup-utterances")
types: [cleanup-utterances]
schedule:
# every 12 h
- cron: '0 3/8 * * *'
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup version-stable R 3.6.3
uses: r-lib/actions/setup-r@v1
with:
r-version: '3.6.3'
env:
CRAN: https://mran.microsoft.com/snapshot/2020-04-12
- name: Query dependencies
run: |
install.packages("remotes")
saveRDS(remotes::dev_package_deps(dependencies = TRUE), "depends.Rds")
shell: Rscript {0}
- name: Cache R packages
uses: actions/cache@master
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-r-${{ hashFiles('depends.Rds') }}
restore-keys: ${{ runner.os }}-r-
- name: Install system dependencies
env:
RHUB_PLATFORM: linux-x86_64-ubuntu-gcc
run: |
Rscript -e "remotes::install_github('r-hub/sysreqs')"
sysreqs=$(Rscript -e "cat(sysreqs::sysreq_commands('DESCRIPTION'))")
sudo -s eval "$sysreqs"
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Cleanup extra comments to utterances voting issues
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
source("contest/_tools/utterances-issues.R")
cleanup_utterances_comments(
owner = "Milano-R",
repo = "erum2020-covidr-contest",
site = "https://milano-r.github.io/erum2020-covidr-contest",
dry_run = FALSE
)
shell: Rscript {0}