-
Notifications
You must be signed in to change notification settings - Fork 3
76 lines (64 loc) · 2.45 KB
/
data-tests.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
# This file determines when GitHub Actions (GA) is triggered and if so what
# sequence of steps continous integration takes.
#
# For a video tutorial explaining these steps click: https://youtu.be/JKF6aXtdLHs
# When any of these files are modified trigger GAs (except for the ones with a '!'):
on:
push:
paths:
- 'raw_data/Field_Maps**'
- '!raw_data/README.md'
- 'R_scripts/CI_1_Generate_reports.R'
- 'R_scripts/GitHubAction_checks.csv'
pull_request:
paths:
- 'raw_data/Field_Maps**'
- '!raw_data/README.md'
- 'R_scripts/CI_1_Generate_reports.R'
- 'R_scripts/GitHubAction_checks.csv'
# Name the workflow as it will appear on GA status page
# https://github.com/SCBI-ForestGEO/SCBImortality/actions
name: data-tests
# Here are all the steps GA takes when triggered:
jobs:
data-tests:
# Set the operating system GA assumes:
runs-on: windows-latest
# Allow only authorized collaborators to trigger GA:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# All steps in workflow:
steps:
# Housekeeping - Import various actions to make process work:
- uses: actions/checkout@v3
# Use this action: https://github.com/actions/checkout#checkout-v3
- uses: r-lib/actions/setup-r@v2
# Use this action: https://github.com/r-lib/actions/tree/v2/setup-r
- uses: r-lib/actions/setup-r-dependencies@v2
# Housekeeping - Run package check (may not be needed):
# - name: Check
# run: |
# options(crayon.enabled = TRUE)
# rcmdcheck::rcmdcheck(args = "--no-manual", error_on = "error")
# shell: Rscript {0}
# Run R script to generate error reports:
- name: Generate reports
id: Generate_reports
run: |
source("R_scripts/CI_1_Generate_reports.R")
shell: Rscript {0}
# Run R script to update progress map:
- name: Update Progress Map
id: update_progress_map
run: |
source("R_scripts/CI_2_progress_map.R")
shell: Rscript {0}
# Commit and push all new files, where commits are assigned to GA bot:
- name: Commit new files
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git pull
git add --all
git commit -am "add data"
git push