Add package and linter checks to CI #13
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
name: R Tests | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
pull_request: | |
branches: | |
- main | |
- dev | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libharfbuzz-dev libfribidi-dev libfreetype6-dev pkg-config libcurl4-openssl-dev | |
- name: Setup R environment | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'latest' | |
- name: Install devtools and package dependencies | |
run: | | |
Rscript -e 'install.packages("devtools", dependencies = NA)' | |
Rscript -e 'devtools::install_deps(dep = TRUE)' | |
- name: Run R tests | |
run: | | |
Rscript -e 'devtools::test()' | |
check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libharfbuzz-dev libfribidi-dev libfreetype6-dev pkg-config libcurl4-openssl-dev | |
- name: Setup R environment | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'latest' | |
- name: Install devtools and package dependencies | |
run: | | |
Rscript -e 'install.packages("devtools", dependencies = NA)' | |
Rscript -e 'devtools::install_deps(dep = TRUE)' | |
- name: Check package | |
run: | | |
Rscript -e 'devtools::check()' | |
linter: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y libharfbuzz-dev libfribidi-dev libfreetype6-dev pkg-config libcurl4-openssl-dev | |
- name: Setup R environment | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: 'latest' | |
- name: Install devtools and package dependencies | |
run: | | |
Rscript -e 'install.packages("devtools", dependencies = NA)' | |
Rscript -e 'devtools::install_deps(dep = TRUE)' | |
- name: Check linting | |
run: | | |
Rscript -e 'lintr::expect_lint_free()' |