-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (56 loc) · 2.06 KB
/
test-container-dl-calc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: CI tests for download and calculate with Apptainer
on:
push:
branches:
- [main, dev]
pull_request:
branches:
- [main, dev]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Apptainer dependencies
run: |
sudo apt-get update && sudo apt-get install -y \
libseccomp-dev \
squashfs-tools \
cryptsetup \
wget
- name: Install Apptainer
run: |
wget https://github.com/apptainer/apptainer/releases/download/v1.1.0/apptainer-1.1.0.tar.gz
tar -xvf apptainer-1.1.0.tar.gz
cd apptainer-1.1.0
./mconfig && make -C builddir && sudo make -C builddir install
- name: Restore .sif file from cache
id: cache-sif
uses: actions/cache@v3
with:
path: beethoven_dl_calc.sif
key: sif-cache-${{ hashFiles('../../containers/beethoven_dl_calc.def') }}
restore-keys: sif-cache-
- name: Build the Apptainer container (if cache miss)
if: steps.cache-sif.outputs.cache-hit != 'true'
run: |
apptainer build my_container.sif path/to/Singularity.def
- name: Cache the .sif file
if: steps.cache-sif.outputs.cache-hit != 'true'
uses: actions/cache@v3
with:
path: beethoven_dl_calc.sif
key: sif-cache-${{ hashFiles('../../containers/beethoven_dl_calc.def') }}
- name: Create run_dl_calc_tests.R dynamically
run: |
echo 'testthat::test_file("/mnt/tests/testthat/test_download.R")' > tests/testthat/run_dl_calc_tests.R
echo 'testthat::test_file("/mnt/tests/testthat/test_calculate.R")' >> tests/testthat/run_dl_calc_tests.R
- name: Run tests inside the container
run: |
apptainer exec \
--bind $PWD/inst:/pipeline \
--bind $PWD/input:/input \
--bind $PWD/_targets:/opt/_targets \
--bind $PWD:/mnt \
Rscript mnt/tests/testhat/run_dl_calc_tests.R