Skip to content

Commit e7f9c2a

Browse files
update template
1 parent d1c4523 commit e7f9c2a

File tree

1 file changed

+6
-26
lines changed

1 file changed

+6
-26
lines changed

inst/pre-commit-gha.yaml

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches-ignore:
55
- 'master'
6+
- 'main'
67
pull_request:
78
types: [opened, synchronize, reopened, ready_for_review]
89

@@ -23,41 +24,18 @@ jobs:
2324
- uses: actions/checkout@v2
2425
with:
2526
fetch-depth: 0
26-
2727
- name: Install system dependencies
2828
if: runner.os == 'Linux'
2929
run: |
30-
sudo apt-get update -qq || (sudo rm /etc/apt/sources.list.d/* && sudo apt-get update -yqq)
31-
sudo apt-get install -y libcurl4-openssl-dev
30+
# your system installation code here
31+
# sudo apt-get install -y libcurl4-openssl-dev
3232
- name: Set up Python
3333
uses: actions/setup-python@v2
3434
with:
3535
python-version: "3.8"
3636
architecture: "x64"
37-
38-
- name: Set up environment
39-
run: |
40-
echo "UBUNTU_VERSION=`grep DISTRIB_RELEASE /etc/lsb-release | sed 's/.*=//g'`" >> $GITHUB_ENV
41-
mkdir -p .local/R/site-packages
42-
echo "R_LIBS_USER=`pwd`/.local/R/site-packages" >> $GITHUB_ENV
43-
- name: Cache R packages
44-
uses: actions/cache@v2
45-
if: startsWith(runner.os, 'Linux')
46-
with:
47-
path: ~/.local/share/renv
48-
key: precommit-${{env.UBUNTU_VERSION}}-renv-
49-
restore-keys: |
50-
precommit-${{env.UBUNTU_VERSION}}-renv-
51-
52-
- name: Install R packages
53-
run: |
54-
if (!requireNamespace("renv", quietly = TRUE)) install.packages("renv")
55-
renv::restore()
56-
shell: Rscript {0}
57-
5837
- name: Run pre-commit
59-
uses: pre-commit/[email protected]
60-
38+
uses: pre-commit/[email protected]
6139
- name: Commit files
6240
if: failure() && startsWith(github.ref, 'refs/heads')
6341
run: |
@@ -73,3 +51,5 @@ jobs:
7351
with:
7452
github_token: ${{ secrets.GITHUB_TOKEN }}
7553
branch: ${{ github.ref }}
54+
env:
55+
RENV_CONFIG_CACHE_ENABLED: FALSE

0 commit comments

Comments
 (0)