Skip to content

Commit

Permalink
Merge 809c6ab into 9305b62
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzwalthert authored Jan 16, 2022
2 parents 9305b62 + 809c6ab commit 8f76e8f
Show file tree
Hide file tree
Showing 128 changed files with 2,233 additions and 406 deletions.
35 changes: 17 additions & 18 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
^Meta$
^doc$
^.*-in_tree$
^.*\.Rproj$
^\.Rproj\.user$
^API$
^README\.Rmd$
^CONTRIBUTING\.md$
^LICENSE\.md$
^Meta$
^README-.*\.png$
^appveyor\.yml$
^tic\.R$
^docs$
^_pkgdown\.yml$
CONTRIBUTING.md
^README\.Rmd$
^\.Rproj\.user$
^\.github$
^\.gitsum$
^gitsum$
revdep
^\.pre-commit-config\.yaml$
^_pkgdown\.yml$
^cran-comments\.md$
^doc$
^docs$
^gitsum$
^inst/WORDLIST$
^inst/hooks/.*$
^revdep$
^tests/testmanual$
^\.pre-commit-config\.yaml$
^brew\-log$
^\.github/$
^tic\.R$
^touchstone$
^\.github$
^LICENSE\.md$
^inst/hooks/$
^inst/WORDLIST$
^vignettes/gsoc_proposal$
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1 @@
tests/testthat/**/*_tree linguist-generated=true
tests/testthat/**/*_tree linguist-generated=true
10 changes: 8 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ on:

name: R-CMD-check

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true


jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand All @@ -27,9 +32,10 @@ jobs:
matrix:
config:
- {os: macOS-latest, r: 'release'}
- {os: windows-latest, r: 'devel'}
- {os: windows-latest, r: 'release'}
- {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"}
- {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
- {os: windows-latest, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/latest"}
- {os: ubuntu-18.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest", http-user-agent: "R/4.0.0 (ubuntu-18.04) R (4.0.0 x86_64-pc-linux-gnu x86_64 linux-gnu) on GitHub Actions" }
- {os: ubuntu-18.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: 'oldrel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
- {os: ubuntu-18.04, r: '3.6', rspm: "https://packagemanager.rstudio.com/cran/__linux__/bionic/latest"}
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/cancel.yaml

This file was deleted.

Empty file removed .github/workflows/check-full.yaml
Empty file.
2 changes: 1 addition & 1 deletion .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
on:
push:
branches: master
branches: main

name: pkgdown

Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: pre-commit
on:
push:
branches-ignore:
- 'master'
- 'main'
pull_request:
types: [opened, synchronize, reopened, ready_for_review]

jobs:
pre-commit:
runs-on: ubuntu-18.04
if: >-
!contains(github.event.head_commit.message, 'ci skip') &&
(
startsWith(github.ref, 'refs/heads') ||
github.event.pull_request.draft == false
)
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.6.0
with:
access_token: ${{ github.token }}
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install system dependencies
if: runner.os == 'Linux'
run: |
# your system installation code here
# sudo apt-get install -y libcurl4-openssl-dev
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"
architecture: "x64"
- name: Run pre-commit
uses: pre-commit/action@v2.0.3
- name: Commit files
if: failure() && startsWith(github.ref, 'refs/heads')
run: |
if [[ `git status --porcelain --untracked-files=no` ]]; then
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git checkout -- .github/workflows
git commit -m "pre-commit" -a
fi
- name: Push changes
if: failure() && startsWith(github.ref, 'refs/heads')
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
env:
RENV_CONFIG_CACHE_ENABLED: FALSE
9 changes: 7 additions & 2 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
on:
push:
branches:
- master
- main
pull_request:
branches:
- master
- main

name: test-coverage

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true


jobs:
test-coverage:
runs-on: macOS-latest
Expand Down
42 changes: 6 additions & 36 deletions .github/workflows/touchstone-comment.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Continuous Benchmarks (Comment)

# read-write repo token
# access to secrets
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

on:
workflow_run:
workflows: ["Continuous Benchmarks (Receive)"]
Expand All @@ -15,38 +17,6 @@ jobs:
${{ github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.conclusion == 'success' }}
steps:
- name: 'Download artifact'
uses: actions/github-script@v3.1.0
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/pr.zip', Buffer.from(download.data));
- run: unzip pr.zip
- name: 'Comment on PR'
uses: actions/github-script@v3
- uses: lorenzwalthert/touchstone/actions/comment@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
var fs = require('fs');
var issue_number = Number(fs.readFileSync('./NR'));
var body = fs.readFileSync('./info.txt').toString();
await github.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issue_number,
body: body
});
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
87 changes: 12 additions & 75 deletions .github/workflows/touchstone-receive.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Continuous Benchmarks (Receive)

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true

on: pull_request

jobs:
prepare:
runs-on: ubuntu-latest
Expand All @@ -9,7 +15,7 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
fetch-depth: 0

- id: read_touchstone_config
run: |
Expand All @@ -33,78 +39,9 @@ jobs:
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up git user
run: |
git config --local user.name "GitHub Actions"
git config --local user.email "actions@github.com"
- name: Ensure base branch is fetched
run: |
git checkout -b $GITHUB_HEAD_REF # this is current ref. This is required for naming.
git branch $GITHUB_BASE_REF remotes/origin/$GITHUB_BASE_REF
- name: Setup R
uses: r-lib/actions/setup-r@master
- name: Query dependencies
run: |
install.packages('remotes')
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: ${{ 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: |
remotes::install_deps(dependencies = TRUE)
remotes::install_github("lorenzwalthert/touchstone")
remotes::install_cran(c('ggplot2', 'dplyr'))
pkg <- basename(getwd())
if (pkg %in% rownames(installed.packages())) {
remove.packages(pkg)
cat('removed package ', pkg, '.', sep = "")
}
shell: Rscript {0}
- name: Checkout benchmarking repo
uses: actions/checkout@v2
with:
repository: ${{ matrix.config.benchmarking_repo }}
ref: ${{ matrix.config.benchmarking_ref }}
path: ${{ matrix.config.benchmarking_path }}
- name: Run benchmarks
run: Rscript -e 'touchstone::run_script("touchstone/script.R")'
- name: Save PR number
run: |
echo ${{ github.event.number }} > ./touchstone/pr-comment/NR
- uses: actions/upload-artifact@v2
with:
name: visual-benchmarks
path: touchstone/plots/
- uses: actions/upload-artifact@v1
with:
name: results
path: touchstone/pr-comment
- uses: actions/download-artifact@v1
with:
name: results
- name: comment PR
run: cat touchstone/pr-comment/info.txt
- uses: actions/upload-artifact@v2
- uses: lorenzwalthert/touchstone/actions/receive@main
with:
name: pr
path: touchstone/pr-comment/
cache-version: 1
benchmarking_repo: ${{ matrix.config.benchmarking_repo }}
benchmarking_ref: ${{ matrix.config.benchmarking_ref }}
benchmarking_path: ${{ matrix.config.benchmarking_path }}
14 changes: 7 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.RData
.Rhistory
.Rproj.user
.gitsum
Meta
R/scratch
doc
.Rproj.user
.Rhistory
.RData
inst/doc
docs
.gitsum
gitsum
R/scratch
inst/doc
revdep/
!revdep/*.md
!revdep/problems.md
touchstone/*
!touchstone/script.R
!touchstone/config.json
!touchstone/script.R
Loading

0 comments on commit 8f76e8f

Please sign in to comment.