chore: apply PR feedback #73
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
# 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 | |
name: R CI | |
on: [push] | |
jobs: | |
style: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Install dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
packages: styler | |
- name: Style | |
run: styler::style_dir() | |
shell: Rscript {0} | |
- name: Check differences | |
run: | | |
if [ -z "$(git status --porcelain)" ]; then | |
echo "No changes to the code style" | |
else | |
echo "Code style differences detected" | |
git status --porcelain | |
git diff | |
exit 1 | |
fi | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
- name: Install dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
with: | |
packages: lintr | |
- name: Lint | |
run: lintr::lint_dir() | |
shell: Rscript {0} | |
env: | |
LINTR_ERROR_ON_LINT: true |