-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #684 from lorenzwalthert/issue-680
- Add one more benchmark plot on recording for cache only (#680).
- Loading branch information
Showing
3 changed files
with
93 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,33 @@ | ||
name: Continuous Benchmarks | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
name: Continuous Benchmarks | ||
|
||
jobs: | ||
build: | ||
runs-on: macOS-latest | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: ubuntu-18.04, r: '4.0.0', rspm: 'https://packagemanager.rstudio.com/all/__linux__/bionic/291'} | ||
|
||
env: | ||
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | ||
RSPM: ${{ matrix.config.rspm }} | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Checkout repo | ||
with: | ||
fetch-depth: 0 | ||
uses: actions/checkout@master | ||
- name: Set up git user | ||
run: | | ||
git config --local user.name "GitHub Actions" | ||
git config --local user.email "[email protected]" | ||
- name: Ensure base branch is fetched | ||
if: ${{ github.event_name == 'pull_request' }} | ||
run: git branch $GITHUB_BASE_REF remotes/origin/$GITHUB_BASE_REF; git branch | ||
|
@@ -27,15 +39,22 @@ jobs: | |
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) | ||
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") | ||
shell: Rscript {0} | ||
|
||
- name: Cache R packages | ||
if: runner.os != 'Windows' | ||
uses: actions/cache@v1 | ||
with: | ||
path: ${{ env.R_LIBS_USER }} | ||
key: ${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} | ||
restore-keys: ${{ hashFiles('.github/R-version') }}-1- | ||
|
||
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-3-${{ hashFiles('.github/depends.Rds') }} | ||
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-3- | ||
- name: Install system dependencies | ||
if: runner.os == 'Linux' | ||
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" | ||
sudo apt-get install libcurl4-openssl-dev libgit2-dev | ||
- name: Install dependencies | ||
run: | | ||
Rscript -e "install.packages(c('gert', 'ggplot2', 'purrr'))" -e "remotes::install_deps(dependencies = TRUE); remotes::install_github('r-lib/bench')" | ||
|
@@ -48,6 +67,10 @@ jobs: | |
path: bench/sources/here | ||
- name: Fetch existing benchmarks | ||
run: Rscript -e 'rlang::with_handlers(bench::cb_fetch(), error = function(e) paste("Could not fetch benchmarks, skipping. The error was", conditionMessage(e)))' | ||
- name: Prepare PR comment | ||
run: | | ||
mkdir -p bench/pr-comment | ||
echo 'Here is how the current PR would change benchmark results:\n' > bench/pr-comment/info.txt | ||
- name: Run benchmarks | ||
run: Rscript -e 'bench::cb_run()' | ||
- name: Show benchmarks | ||
|
@@ -59,3 +82,13 @@ jobs: | |
- name: Push benchmarks | ||
if: ${{ github.event_name == 'push' }} | ||
run: Rscript -e "bench::cb_push()" | ||
- uses: actions/upload-artifact@v1 | ||
with: | ||
name: results | ||
path: bench/pr-comment | ||
- uses: actions/download-artifact@v1 | ||
with: | ||
name: results | ||
- name: comment PR | ||
#uses: machine-learning-apps/pr-comment@master | ||
run: cat bench/pr-comment/info.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters