-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (90 loc) · 3.64 KB
/
QA_QC_checks.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# Set the list of files that when modified will trigger GitHub Actions
# (GA) continuous integration (CI) to run
# For a video tutorial explaining these steps for the similarly structured
# SCBI mortality census (https://github.com/SCBI-ForestGEO/SCBImortality),
# click this link to YouTube: https://youtu.be/JKF6aXtdLHs
on:
push:
paths:
- 'resources/raw_data/**'
- 'Rscripts/survey_forms/create_master_csv_2021_and_after.R'
- 'Rscripts/Generate_reports.R'
- 'Rscripts/Generate_warnings.R'
- 'README.Rmd'
pull_request:
paths:
- 'resources/raw_data/**'
- 'Rscripts/survey_forms/create_master_csv_2021_and_after.R'
- 'Rscripts/Generate_reports.R'
- 'Rscripts/Generate_warnings.R'
- 'README.Rmd'
# Name the workflow as it will appear on GA status page
# https://github.com/SCBI-ForestGEO/Dendrobands/actions
name: QA_QC_checks
jobs:
QA_QC_checks:
# Set the operating system CI assumes:
runs-on: macOS-latest
# Allow only authorized collaborators to trigger GA:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
# All steps in workflow:
steps:
# Housekeeping: Use various GA tools, install R, install pandoc
# (to be able to use RMarkdown)
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-pandoc@v2
# Housekeeping: Install all packages listed in DESCRIPTION file
- name: Install dependencies
run: |
install.packages(c("remotes", "rcmdcheck", "rmarkdown"))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
# 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}
# Create data/scbi.dendroAll_YEAR.csv from resources/raw_data/YEAR/
# csv's
- name: Create current year's master data csv
id: create_master_csv
run: |
source("Rscripts/survey_forms/create_master_csv_2021_and_after.R")
shell: Rscript {0}
# Test for data collection errors that require field fixes, outputs
# saved in testthat/reports/
- name: Generate error reports
id: generate_error_reports
run: |
source("Rscripts/Generate_reports.R")
shell: Rscript {0}
# Test for warnings, outputs saved in testthat/reports/
- name: Generate warning reports
id: generate_warning_reports
run: |
source("Rscripts/Generate_warnings.R")
shell: Rscript {0}
# Recompute annual summaries in results/dendro_trees_dbhcount/
- name: Recompute annual summaries
run: |
source("Rscripts/analysis/dendrotrees_by_sp-survey-dbh.R")
shell: Rscript {0}
# Update dashboard: repository README.md front page
- name: Update README
run: |
Rscript -e 'rmarkdown::render("README.Rmd")'
rm README.html
# Commit and push all new files, assigned to GA bot
- name: Commit and push all new files
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git add --all || echo "No changes to commit"
git commit -m "Added/modified files and updated README" || echo "No changes to commit"
git push origin
# Use testthat package to issue notifications of any data collection errors
- name: Are there any data collection?
run: Rscript testthat.R