From 07b69b3589ba4c86f95a77d7639dbcbe9ad2572e Mon Sep 17 00:00:00 2001 From: pixup1 Date: Sat, 30 Nov 2024 20:02:46 +0100 Subject: [PATCH] Add package and linter checks to CI --- .Rbuildignore | 3 +- .github/workflows/r-tests.yml | 52 +++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/.Rbuildignore b/.Rbuildignore index b5b2d5d..b3b5027 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,2 +1,3 @@ ^\.lintr$ -^LICENSE\.md$ \ No newline at end of file +^LICENSE\.md$ +^\.github$ \ No newline at end of file diff --git a/.github/workflows/r-tests.yml b/.github/workflows/r-tests.yml index 48f6b63..1c84508 100644 --- a/.github/workflows/r-tests.yml +++ b/.github/workflows/r-tests.yml @@ -36,3 +36,55 @@ jobs: - 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()' \ No newline at end of file