Skip to content

test: add basic tests for run & main.R #3

test: add basic tests for run & main.R

test: add basic tests for run & main.R #3

Workflow file for this run

name: tests
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
permissions:
contents: read
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Parse environment.json and set Docker image
id: docker_image
run: |
IMAGE=$(jq -r '.base_image' .codeocean/environment.json)
IMAGE=${IMAGE//codeocean/nciccbr}
echo "image=$IMAGE" >> $GITHUB_OUTPUT
echo "Using Docker image: $IMAGE"
- name: Run tests in Docker
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
${{ steps.docker_image.outputs.image }} \
Rscript tests/testthat.R