-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (79 loc) · 2.85 KB
/
testing_docker.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Testing Docker image
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
tags:
- v*
schedule:
# Every 01:00 Sunday re-run the test on the main branch
- cron: '0 1 * * 0'
workflow_dispatch:
jobs:
docker_testing:
runs-on: ubuntu-latest
name: Running Docker testing
steps:
- name: Install Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Updated python version
run: python3 --version
- name: Install python dependencies
run: |
python3 -m pip install -U pip
python3 -m pip install -U numpy Pillow
- name: Fetch source code
uses: actions/checkout@v2
- name: Build docker image
run: docker build -t plotclip_test:latest ./
- name: Compress docker image
run: docker save plotclip_test:latest | gzip -7 -c - > plotclip_test_image.tar.gz
- name: Upload docker image
uses: actions/upload-artifact@v2
with:
name: plotclip_test_image
path: plotclip_test_image.tar.gz
- name: Create folders
run: |
mkdir ./inputs && chmod 777 ./inputs
mkdir ./outputs && chmod 777 ./outputs
- name: Download testing data files
run: |
curl -X GET https://de.cyverse.org/dl/d/4AF1E272-6A28-400D-B102-E0F6F168BA10/plotclip_sample_data.tar.gz > test_data.tar.gz
tar xvzf test_data.tar.gz -C "./inputs/"
chmod a+r ./inputs/*
- name: Folder contents
run: |
echo "Current folder" && ls -l
echo "Inputs folder" && ls -l ./inputs
echo "Outputs folder" && ls -l ./outputs
- name: Run docker test
run: docker run --rm -v "${PWD}/inputs:/inputs" -v "${PWD}/outputs:/outputs" plotclip_test:latest --working_space /outputs --metadata /inputs/experiment.yaml /inputs/plots.json /inputs/orthomosaic.tif
- name: Output folder contents
run: echo "Outputs folder" && ls -l ./outputs
- name: Check outputs
run: |
chmod +x "./.github/workflows/docker_test_check_rgb.sh"
"./.github/workflows/docker_test_check_rgb.sh"
- name: Data quality check
run: |
mkdir -p test_data
curl -X GET "https://de.cyverse.org/dl/d/9CBF1C3E-23B1-4A33-B239-34E3B6CB7523/ci_soilmask_results.tar.gz" > ci_soilmask_results.tar.gz
tar xvzf ci_soilmask_results.tar.gz -C "./test_data"
python3 './.github/workflows/check_plotclip_details.py' ./test_data ./outputs
artifact_cleanup:
runs-on: ubuntu-latest
needs: [docker_testing]
name: Cleanup artifacts upon success
steps:
- name: Remove docker artifact
uses: geekyeggo/delete-artifact@v1
with:
name: plotclip_test_image