diff --git a/.Rbuildignore b/.Rbuildignore index 8d1f7a83..1e26a16a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -6,6 +6,7 @@ ^Meta$ ^README-.*\.png$ ^README\.Rmd$ +^Rperform$ ^\.Rproj\.user$ ^\.github$ ^\.gitsum$ @@ -22,4 +23,3 @@ ^tic\.R$ ^touchstone$ ^vignettes/gsoc_proposal$ -^Rperform$ diff --git a/.github/workflows/check-full.yaml b/.github/workflows/check-full.yaml deleted file mode 100644 index dc4fb8f5..00000000 --- a/.github/workflows/check-full.yaml +++ /dev/null @@ -1,65 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help - -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - - -name: R-CMD-check - -jobs: - R-CMD-check: - runs-on: ${{ matrix.config.os }} - - name: ${{ matrix.config.os }} (${{ matrix.config.r }}) - - strategy: - fail-fast: false - matrix: - config: - - {os: macOS-latest, r: 'release'} - - - {os: windows-latest, r: 'release'} - # Use 3.6 to trigger usage of RTools35 - - {os: windows-latest, r: '3.6'} - - # Use older ubuntu to maximise backward compatibility - - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} - - {os: ubuntu-latest, r: 'release'} - - {os: ubuntu-latest, r: 'oldrel-1'} - - {os: ubuntu-latest, r: 'oldrel-2'} - - {os: ubuntu-latest, r: 'oldrel-3'} - - {os: ubuntu-latest, r: 'oldrel-4'} - - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - R_KEEP_PKG_SOURCE: yes - - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - r-version: ${{ matrix.config.r }} - http-user-agent: ${{ matrix.config.http-user-agent }} - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::rcmdcheck - needs: check - - - uses: r-lib/actions/check-r-package@v2 - with: - error-on: '"note"' - env: - _R_CHECK_FORCE_SUGGESTS_: false - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml deleted file mode 100644 index 0b260216..00000000 --- a/.github/workflows/pkgdown.yaml +++ /dev/null @@ -1,46 +0,0 @@ -# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples -# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help -on: - push: - branches: [main, master] - pull_request: - branches: [main, master] - release: - types: [published] - workflow_dispatch: - -name: pkgdown - -jobs: - pkgdown: - runs-on: ubuntu-latest - # Only restrict concurrency for non-PR jobs - concurrency: - group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-pandoc@v2 - - - uses: r-lib/actions/setup-r@v2 - with: - use-public-rspm: true - - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::pkgdown, local::. - needs: website - - - name: Build site - run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) - shell: Rscript {0} - - - name: Deploy to GitHub pages 🚀 - if: github.event_name != 'pull_request' - uses: JamesIves/github-pages-deploy-action@4.1.4 - with: - clean: false - branch: gh-pages - folder: docs diff --git a/.github/workflows/pr-commands.yaml b/.github/workflows/pr-commands.yaml deleted file mode 100644 index fad25458..00000000 --- a/.github/workflows/pr-commands.yaml +++ /dev/null @@ -1,71 +0,0 @@ -on: - issue_comment: - types: [created] -name: Commands -jobs: - document: - if: startsWith(github.event.comment.body, '/document') - name: document - runs-on: macOS-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - uses: r-lib/actions/pr-fetch@master - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - uses: r-lib/actions/setup-r@master - - name: Install dependencies - run: Rscript -e 'install.packages(c("remotes", "roxygen2"))' -e 'remotes::install_deps(dependencies = TRUE)' - - name: Document - run: Rscript -e 'roxygen2::roxygenise()' - - name: commit - run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" - git add man/\* NAMESPACE - git commit -m 'Document' - - uses: r-lib/actions/pr-push@master - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - style: - if: startsWith(github.event.comment.body, '/style') - name: style - runs-on: macOS-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - uses: r-lib/actions/pr-fetch@master - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - - uses: r-lib/actions/setup-r@master - - name: Install dependencies - run: Rscript -e 'install.packages("styler")' - - name: save R.cache location - id: save-r-cache-location - run: | - cat("##[set-output name=r-cache-location;]", R.cache::getCacheRootPath(), "\n", sep = "") - shell: Rscript {0} - - name: R.cache cache - uses: actions/cache@v2 - env: - cache-name: r-cache - with: - path: ${{ r-cache-location }} - key: ${{ runner.os }}-${{ env.cache-name }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-${{ env.cache-name }}- - ${{ runner.os }}- - - - name: Style - run: Rscript -e 'styler::style_pkg()' - - name: commit - run: | - git config --local user.email "actions@github.com" - git config --local user.name "GitHub Actions" - git add \*.R - git commit -m 'Style' - - uses: r-lib/actions/pr-push@master - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml deleted file mode 100644 index 8886f2e4..00000000 --- a/.github/workflows/pre-commit.yaml +++ /dev/null @@ -1,55 +0,0 @@ -name: pre-commit -on: - push: - branches-ignore: - - 'master' - - 'main' - pull_request: - types: [opened, synchronize, reopened, ready_for_review] - -jobs: - pre-commit: - runs-on: ubuntu-latest - 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 diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml deleted file mode 100644 index c4344573..00000000 --- a/.github/workflows/test-coverage.yaml +++ /dev/null @@ -1,50 +0,0 @@ -on: - push: - branches: - - main - pull_request: - branches: - - main - -name: test-coverage - -jobs: - test-coverage: - runs-on: macOS-latest - env: - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: actions/checkout@v2 - - - uses: r-lib/actions/setup-r@master - - - uses: r-lib/actions/setup-pandoc@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 - uses: actions/cache@v1 - with: - path: ${{ env.R_LIBS_USER }} - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- - - - name: Install dependencies - run: | - install.packages(c("remotes")) - remotes::install_deps(dependencies = TRUE) - remotes::install_cran("covr") - shell: Rscript {0} - - - name: Test coverage - run: covr::codecov() - shell: Rscript {0} - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true diff --git a/.github/workflows/touchstone-comment.yaml b/.github/workflows/touchstone-comment.yaml deleted file mode 100644 index c3b8eea0..00000000 --- a/.github/workflows/touchstone-comment.yaml +++ /dev/null @@ -1,22 +0,0 @@ -name: Continuous Benchmarks (Comment) - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -on: - workflow_run: - workflows: ["Continuous Benchmarks (Receive)"] - types: - - completed - -jobs: - upload: - runs-on: ubuntu-latest - if: > - ${{ github.event.workflow_run.event == 'pull_request' && - github.event.workflow_run.conclusion == 'success' }} - steps: - - uses: lorenzwalthert/touchstone/actions/comment@main - with: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/touchstone-receive.yaml b/.github/workflows/touchstone-receive.yaml deleted file mode 100644 index bd4ee2b1..00000000 --- a/.github/workflows/touchstone-receive.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: Continuous Benchmarks (Receive) - -concurrency: - group: ${{ github.workflow }}-${{ github.head_ref }} - cancel-in-progress: true - -on: pull_request - -jobs: - prepare: - runs-on: ubuntu-latest - outputs: - config: ${{ steps.read_touchstone_config.outputs.config }} - steps: - - name: Checkout repo - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - id: read_touchstone_config - run: | - content=`cat ./touchstone/config.json` - # the following lines are only required for multi line json - content="${content//'%'/'%25'}" - content="${content//$'\n'/'%0A'}" - content="${content//$'\r'/'%0D'}" - # end of optional handling for multi line json - echo "::set-output name=config::$content" - build: - needs: prepare - runs-on: ${{ matrix.config.os }} - strategy: - fail-fast: false - matrix: - config: - - ${{ fromJson(needs.prepare.outputs.config) }} - env: - R_REMOTES_NO_ERRORS_FROM_WARNINGS: true - RSPM: ${{ matrix.config.rspm }} - GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} - steps: - - uses: lorenzwalthert/touchstone/actions/receive@main - with: - cache-version: 1 - benchmarking_repo: ${{ matrix.config.benchmarking_repo }} - benchmarking_ref: ${{ matrix.config.benchmarking_ref }} - benchmarking_path: ${{ matrix.config.benchmarking_path }} diff --git a/rperform/.gitignore b/rperform/.gitignore index 56cba0b0..08ae79c3 100644 --- a/rperform/.gitignore +++ b/rperform/.gitignore @@ -1,6 +1,6 @@ * -!script.R -!config.json !.gitignore +!config.json +!footer.R !header.R -!footer.R \ No newline at end of file +!script.R diff --git a/rperform/footer.R b/rperform/footer.R index 96611c4d..36b80419 100644 --- a/rperform/footer.R +++ b/rperform/footer.R @@ -1,7 +1,3 @@ - # You can modify the PR comment footer here. You can use github markdown e.g. # emojis like :tada:. -link <- "https://github.com/analyticalmonk/Rperform#readme" -glue::glue( - "\n--------------------------------------------------\n" -) \ No newline at end of file +glue::glue("") diff --git a/rperform/header.R b/rperform/header.R index 0c619dd3..3e95298a 100644 --- a/rperform/header.R +++ b/rperform/header.R @@ -6,7 +6,7 @@ glue::glue( " after running `", test_function, "` function", - " on this PR branch.", + " on this PR branch. ", "Check out the test results data set in csv ", csv_url, "\n", diff --git a/rperform/script.R b/rperform/script.R index 96fdc221..f364f0ef 100644 --- a/rperform/script.R +++ b/rperform/script.R @@ -3,13 +3,13 @@ ## TEST 1 Rperform::plot_metrics( - test_path = "tests/testthat/test-rmd.R", - metric = "time", num_commits = 10, - save_data = TRUE, - save_plots = TRUE + test_path = "tests/testthat/test-rmd.R", + metric = "time", + save_data = TRUE, + save_plots = TRUE, + total_width_in = 20 ) - ## TEST 2 # Rperform::plot_metrics( # test_path = "inst/tests/test-join.r", @@ -40,4 +40,4 @@ Rperform::plot_metrics( # branch2 = "master", # save_data = TRUE, # save_plots = TRUE -# ) \ No newline at end of file +# ) diff --git a/tests/testthat.R b/tests/testthat.R index 08ba7695..20dfb7fa 100644 --- a/tests/testthat.R +++ b/tests/testthat.R @@ -1,4 +1,3 @@ library(testthat) library(styler) - test_check("styler")