From ce6ad921de927a01f7b9e19af561d1f28df2636f Mon Sep 17 00:00:00 2001 From: "Connor T. Jerzak" Date: Sun, 1 Jun 2025 17:44:58 -0400 Subject: [PATCH] Add GitHub Actions workflow to run unit tests --- .github/workflows/tests.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..2911bac --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,25 @@ +name: R package tests + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: r-lib/actions/setup-r@v2 + - name: Install dependencies + run: | + install.packages(c("remotes", "testthat")) + remotes::install_deps("DescriptiveRepresentationCalculator", dependencies = TRUE) + shell: Rscript {0} + - name: Install package + run: R CMD INSTALL DescriptiveRepresentationCalculator + - name: Run unit tests + run: | + R -q -e 'testthat::test_dir("DescriptiveRepresentationCalculator/tests/testthat")' +