From 0de06a12887d81e649c593dd98cc001ced9b0181 Mon Sep 17 00:00:00 2001 From: m-kolomanski Date: Thu, 31 Oct 2024 10:25:57 +0100 Subject: [PATCH] feat: added tests to CI --- .github/workflows/admiral.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/admiral.yml b/.github/workflows/admiral.yml index e87c518..b04eeeb 100644 --- a/.github/workflows/admiral.yml +++ b/.github/workflows/admiral.yml @@ -53,6 +53,27 @@ jobs: needs: get_r_version with: r-version: "${{ needs.get_r_version.outputs.r-version }}" + test: + runs-on: ubuntu-latest + needs: get_r_version + container: + image: "ghcr.io/pharmaverse/admiralci-${{ needs.get_r_version.outputs.r-version }}:latest" + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up R + uses: r-lib/actions/setup-r@v2 + + - name: Install dependencies + run: | + Rscript -e 'install.packages("remotes")' + Rscript -e 'remotes::install_deps(dependencies = TRUE)' + + - name: Run tests + run: | + Rscript -e 'if (!requireNamespace("testthat", quietly = TRUE)) install.packages("testthat")' + Rscript -e 'testthat::test_dir("tests/testthat")' check: name: Check uses: pharmaverse/admiralci/.github/workflows/r-cmd-check.yml@main