Skip to content

Commit

Permalink
Added draft lintr script
Browse files Browse the repository at this point in the history
  • Loading branch information
rmbielby committed Jan 12, 2024
1 parent da42ca8 commit 19d1b71
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/lintr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
on:
push:
branches: [ "main" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
schedule:
- cron: '20 3 * * 0'

name: lintr

permissions:
contents: read

jobs:
lintr:
runs-on: ${{ matrix.config.os }}

name: Run lintr scanning

strategy:
fail-fast: false
matrix:
config:
# Running on mac as it's quicker to build
- {os: macOS-latest, r: 'release'}

permissions:
contents: read # for checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup R
uses: r-lib/actions/setup-r@4e1feaf90520ec1215d1882fdddfe3411c08e492
with:
r-version: 4.2.1
use-public-rspm: true

- name: resotre renv
uses: r-lib/actions/setup-renv@v2
with:
extra-packages: lintr

- name: Run lintr
run: lintr::sarif_output(lintr::lint_dir("."), "lintr-results.sarif")
shell: Rscript {0}
continue-on-error: true

- name: Upload analysis results to GitHub
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: lintr-results.sarif
wait-for-processing: true

0 comments on commit 19d1b71

Please sign in to comment.