Skip to content

Running pre-commit alternatively #14

Running pre-commit alternatively

Running pre-commit alternatively #14

Workflow file for this run

name: Pre-commit
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
pre-commit:
name: Pre-commit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v3
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Cache pre-commit
uses: actions/cache@v4
id: cache-pre-commit
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config') }}
- name: Setup pre-commit
if: steps.cache-pre-commit.outputs.cache-hit != 'true'
run: |
pip install pre-commit
pre-commit install
shell: bash
- name: Install styler
run: |
options(repos = c(CRAN = "https://packagemanager.posit.co/cran/__linux__/jammy/latest"))
install.packages("styler")
shell: Rscript {0}
- name: Run pre-commit hooks
bash: pre-commit run --all-files