From 68ceaf59c25fb8e48202a62b73124e7d9247baf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Cs=C3=A1rdi?= Date: Fri, 4 Mar 2022 13:19:11 +0100 Subject: [PATCH] usethis::use_tidy_github_actions() --- .Rbuildignore | 1 + .github/workflows/R-CMD-check.yaml | 2 ++ .github/workflows/pkgdown.yaml | 23 +++++++++++++---------- .github/workflows/pr-commands.yaml | 12 +++++++----- .github/workflows/test-coverage.yaml | 2 +- README.Rmd | 4 ++-- README.md | 25 +++++++++---------------- codecov.yml | 14 ++++++++++++++ 8 files changed, 49 insertions(+), 34 deletions(-) create mode 100644 codecov.yml diff --git a/.Rbuildignore b/.Rbuildignore index c8319c5c3..63da8c603 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -33,3 +33,4 @@ ^src/.*[.]gc.*$ ^cache$ ^man/chunks/FAQ_cache$ +^codecov\.yml$ diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 1d213adf4..62606bf08 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -58,3 +58,5 @@ jobs: needs: check - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index b4ba91cf0..a048558bd 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -14,6 +14,9 @@ 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 }} R_CLI_NUM_COLORS: 256 @@ -34,14 +37,14 @@ jobs: local::./tests/testthat/progresstest needs: website - - name: Deploy package - if: github.event_name != 'pull_request' - run: | - git config --local user.name "$GITHUB_ACTOR" - git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" - Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} - - name: Build site without deploying - if: github.event_name == 'pull_request' - run: | - Rscript -e 'pkgdown::build_site(preview = FALSE, install = FALSE)' + - 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 index 69b545f8f..97271eb29 100644 --- a/.github/workflows/pr-commands.yaml +++ b/.github/workflows/pr-commands.yaml @@ -30,7 +30,8 @@ jobs: needs: pr-document - name: Document - run: Rscript -e 'roxygen2::roxygenise()' + run: roxygen2::roxygenise() + shell: Rscript {0} - name: commit run: | @@ -58,12 +59,13 @@ jobs: - uses: r-lib/actions/setup-r@v2 - - uses: r-lib/actions/setup-r-dependencies@v2 - with: - extra-packages: any::styler + - name: Install dependencies + run: install.packages("styler") + shell: Rscript {0} - name: Style - run: Rscript -e 'styler::style_pkg()' + run: styler::style_pkg() + shell: Rscript {0} - name: commit run: | diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 50b91976c..4b6541829 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -27,5 +27,5 @@ jobs: needs: coverage - name: Test coverage - run: covr::codecov() + run: covr::codecov(quiet = FALSE) shell: Rscript {0} diff --git a/README.Rmd b/README.Rmd index 516c96936..bc2834426 100644 --- a/README.Rmd +++ b/README.Rmd @@ -36,10 +36,10 @@ asciicast::init_knitr_engine( > Helpers for Developing Command Line Interfaces -[![R build status](https://github.com/r-lib/cli/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/cli/actions) +[![R-CMD-check](https://github.com/r-lib/cli/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/cli/actions/workflows/R-CMD-check.yaml) [![](https://www.r-pkg.org/badges/version/cli)](https://www.r-pkg.org/pkg/cli) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/cli)](https://www.r-pkg.org/pkg/cli) -[![Coverage Status](https://img.shields.io/codecov/c/github/r-lib/cli/main.svg)](https://codecov.io/github/r-lib/cli?branch=main) +[![Codecov test coverage](https://codecov.io/gh/r-lib/cli/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/cli?branch=main) A suite of tools to build attractive command line interfaces diff --git a/README.md b/README.md index 132282571..8b9e946f5 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,17 @@ -cli -=== +# cli > Helpers for Developing Command Line Interfaces -[![R build -status](https://github.com/r-lib/cli/workflows/R-CMD-check/badge.svg)](https://github.com/r-lib/cli/actions) +[![R-CMD-check](https://github.com/r-lib/cli/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-lib/cli/actions/workflows/R-CMD-check.yaml) [![](https://www.r-pkg.org/badges/version/cli)](https://www.r-pkg.org/pkg/cli) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/cli)](https://www.r-pkg.org/pkg/cli) -[![Coverage -Status](https://img.shields.io/codecov/c/github/r-lib/cli/main.svg)](https://codecov.io/github/r-lib/cli?branch=main) +[![Codecov test +coverage](https://codecov.io/gh/r-lib/cli/branch/main/graph/badge.svg)](https://app.codecov.io/gh/r-lib/cli?branch=main) A suite of tools to build attractive command line interfaces (CLIs), @@ -25,8 +23,7 @@ styles. ------------------------------------------------------------------------ -Features -======== +# Features - Build a CLI using semantic elements: headings, lists, alerts, paragraphs. @@ -39,8 +36,7 @@ Features - Support for pluralized messages. - ANSI styled string manipulation. -Installation -============ +# Installation Install the stable version from CRAN: @@ -48,8 +44,7 @@ Install the stable version from CRAN: install.packages("cli") ``` -Short tour ----------- +## Short tour Some of the more commonly used cli elements, and features. @@ -189,14 +184,12 @@ clean() -Documentation -------------- +## Documentation See at [`https://cli.r-lib.org/`](https://cli.r-lib.org/reference/index.html) and also in the installed package: `help(package = "cli")`. -License -======= +# License MIT © RStudio diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..04c558599 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,14 @@ +comment: false + +coverage: + status: + project: + default: + target: auto + threshold: 1% + informational: true + patch: + default: + target: auto + threshold: 1% + informational: true