Skip to content

Commit 8ad020b

Browse files
ci: create test workflow
1 parent fbbaf10 commit 8ad020b

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [ main, dev ]
6+
pull_request:
7+
branches: [ main, dev ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Parse environment.json and set Docker image
16+
id: docker_image
17+
run: |
18+
IMAGE=$(jq -r '.base_image' .codeocean/environment.json)
19+
IMAGE=${IMAGE//codeocean/nciccbr}
20+
echo "image=$IMAGE" >> $GITHUB_OUTPUT
21+
echo "Using Docker image: $IMAGE"
22+
23+
- name: Run tests in Docker
24+
run: |
25+
docker run --rm \
26+
-v ${{ github.workspace }}:/workspace \
27+
-w /workspace \
28+
${{ steps.docker_image.outputs.image }} \
29+
Rscript tests/testthat.R

0 commit comments

Comments
 (0)