@@ -34,21 +34,25 @@ jobs:
34
34
git checkout -b $GITHUB_HEAD_REF
35
35
git branch $GITHUB_BASE_REF remotes/origin/$GITHUB_BASE_REF
36
36
- name : Setup R
37
+ if : ${{ github.event_name == 'pull_request' }}
37
38
uses : r-lib/actions/setup-r@master
38
39
- name : Query dependencies
40
+ if : ${{ github.event_name == 'pull_request' }}
39
41
run : |
40
42
install.packages('remotes')
41
43
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
42
44
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
43
45
shell : Rscript {0}
44
46
- name : Cache R packages
47
+ if : ${{ github.event_name == 'pull_request' }}
45
48
if : runner.os != 'Windows'
46
49
uses : actions/cache@v1
47
50
with :
48
51
path : ${{ env.R_LIBS_USER }}
49
52
key : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-3-${{ hashFiles('.github/depends.Rds') }}
50
53
restore-keys : ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-3-
51
54
- name : Install system dependencies
55
+ if : ${{ github.event_name == 'pull_request' }}
52
56
if : runner.os == 'Linux'
53
57
env :
54
58
RHUB_PLATFORM : linux-x86_64-ubuntu-gcc
@@ -58,34 +62,42 @@ jobs:
58
62
sudo -s eval "$sysreqs"
59
63
sudo apt-get install libcurl4-openssl-dev libgit2-dev
60
64
- name : Install dependencies
65
+ if : ${{ github.event_name == 'pull_request' }}
61
66
run : |
62
67
Rscript -e "install.packages(c('ggplot2', 'purrr'))" -e "remotes::install_deps(dependencies = TRUE); remotes::install_github(c('r-lib/bench', 'lorenzwalthert/touchstone')); "
63
68
R CMD INSTALL .
64
69
- name : Checkout benchmarking repo
70
+ if : ${{ github.event_name == 'pull_request' }}
65
71
uses : actions/checkout@v2
66
72
with :
67
73
repository : lorenzwalthert/here
68
74
ref : ca9c8e69c727def88d8ba1c8b85b0e0bcea87b3f
69
75
path : touchstone/sources/here
70
76
- name : Prepare PR comment
77
+ if : ${{ github.event_name == 'pull_request' }}
71
78
run : |
72
79
mkdir -p touchstone/sources
73
80
mkdir -p touchstone/pr-comment
74
81
mkdir -p touchstone/plots
75
82
echo "Here is how the current PR would change benchmark results when merged into $GITHUB_BASE_REF:" > touchstone/pr-comment/info.txt
76
83
echo "$GITHUB_EVENT_PULL_REQUEST_HEAD_SHA" >> touchstone/pr-comment/info.txt
77
84
- name : Run benchmarks
85
+ if : ${{ github.event_name == 'pull_request' }}
78
86
run : Rscript 'touchstone/script.R'
79
87
- uses : actions/upload-artifact@v2
88
+ if : ${{ github.event_name == 'pull_request' }}
80
89
with :
81
90
name : visual-benchmarks
82
91
path : touchstone/plots/
83
92
- uses : actions/upload-artifact@v1
93
+ if : ${{ github.event_name == 'pull_request' }}
84
94
with :
85
95
name : results
86
96
path : touchstone/pr-comment
87
97
- uses : actions/download-artifact@v1
98
+ if : ${{ github.event_name == 'pull_request' }}
88
99
with :
89
100
name : results
90
101
- name : comment PR
102
+ if : ${{ github.event_name == 'pull_request' }}
91
103
run : cat touchstone/pr-comment/info.txt
0 commit comments