Skip to content

chore: restored spellcheck #161

chore: restored spellcheck

chore: restored spellcheck #161

Workflow file for this run

# Source: https://github.com/pharmaverse/admiralci
# Stripped down version of admiralci checks. Good for
# the developement process. When package is ready to
# be published, revisit and add release-related
# workflows.
name: admiral CI/CD Wortkflows
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: admiral-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
R_VERSION: "release"
jobs:
get_r_version:
name: Get R version
runs-on: ubuntu-latest
outputs:
r-version: ${{ steps.get_r_version.outputs.R_VERSION }}
steps:
- name: Get R Version for Downstream Container Jobs
id: get_r_version
run: echo "R_VERSION=$R_VERSION" >> $GITHUB_OUTPUT
shell: bash
spellcheck:
name: Spelling
runs-on: ubuntu-latest
needs: get_r_version
container:
image: "ghcr.io/pharmaverse/admiralci-${{ needs.get_r_version.outputs.r-version }}:latest"
steps:
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v8
- name: Checkout repo
uses: actions/[email protected]
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Checkout repository
uses: actions/[email protected]
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
- name: Restore cache
uses: actions/cache@v4
with:
path: |
~/.staged.dependencies
key: staged-deps
- name: Run Staged dependencies
uses: insightsengineering/staged-dependencies-action@v1
with:
run-system-dependencies: true
renv-restore: false
enable-check: false
direction: upstream
git-ref: ${{ steps.branch-name.outputs.current_branch }}
- name: Run Spellcheck
uses: insightsengineering/r-spellcheck-action@v3
lint:
name: Lint
runs-on: ubuntu-latest
needs: get_r_version
container:
image: "ghcr.io/pharmaverse/admiralci-${{ needs.get_r_version.outputs.r-version }}:latest"
steps:
- name: Get branch names
id: branch-name
uses: tj-actions/branch-names@v8
- name: Checkout repo
uses: actions/[email protected]
if: github.event_name == 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Checkout repository
uses: actions/[email protected]
if: github.event_name != 'pull_request'
with:
ref: ${{ steps.branch-name.outputs.head_ref_branch }}
- name: Restore cache
uses: actions/cache@v4
with:
path: |
~/.staged.dependencies
key: staged-deps
- name: Run Staged dependencies
uses: insightsengineering/staged-dependencies-action@v1
with:
run-system-dependencies: true
renv-restore: false
enable-check: false
direction: upstream
git-ref: ${{ steps.branch-name.outputs.current_branch }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
- name: Install latest release of lintr
run: |
install.packages("lintr", repos = "https://packagemanager.posit.co/cran/latest/")
shell: Rscript {0}
- name: Lint
run: |
lints <- lintr::lint_package()
if (length(lints) > 0L) {
print(lints)
stop("Lints detected. Please review and adjust code according to the comments provided.", call. = FALSE)
}
shell: Rscript {0}