-
-
Notifications
You must be signed in to change notification settings - Fork 0
121 lines (102 loc) · 3.14 KB
/
pipeline-test.yml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# This workflow will build opal, install its build, then runs the tests with pytest.
name: Test Model Pipeline Inference
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
pipeline:
timeout-minutes: 10
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout repository with submodules
uses: actions/checkout@v3
with:
submodules: true
- name: Execute Pipeline
working-directory: src/
shell: bash
run: |
chmod +x pipeline.sh
./pipeline.sh cache
- name: Check Dataset exists and is not empty
if: always()
working-directory: src/datasets/
run: |
dataset=$(ls *.csv 2>/dev/null | head -n 1)
[ -f "$dataset" ] || { echo "Dataset file not found"; exit 1; }
[ -s "$dataset" ] || { echo "Dataset file is empty"; exit 1; }
- name: Check Pipeline Cache exists and is not empty
if: always()
working-directory: src/.pipeline_cache/
run: |
pipeline_cache=cache.env
[ -f "$pipeline_cache" ] || { echo "Pipeline Cache file not found"; exit 1; }
[ -s "$pipeline_cache" ] || { echo "Pipeline Cache file is empty"; exit 1; }
- name: Check Dist exists and is not empty
if: always()
working-directory: src/dist/
run: |
dist=$(ls *.tar.gz 2>/dev/null | head -n 1)
[ -f "$dist" ] || { echo "Dist file not found"; exit 1; }
[ -s "$dist" ] || { echo "Dist file is empty"; exit 1; }
- name: Preprocess Docker Logs
working-directory: src/
if: always()
run: |
for SVC in 1.preprocess 2.svness 3.preprocess 4.export; do
docker compose \
--profile files \
-f preprocess/docker-compose.yml \
--env-file preprocess/osu-data-docker/.env \
logs $SVC > ${SVC}.log
done
- name: Export src as Artifact
if: always()
uses: actions/upload-artifact@v3
with:
name: src
path: src/
- name: Export built wheel as Artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: src/dist/
model:
needs: [ pipeline ]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.9", "3.10", "3.11" ]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Get Dist
uses: actions/download-artifact@v3
with:
name: dist
path: src/dist/
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
- name: Install opal build
working-directory: src/dist/
run: |
python -m pip install *.whl
- name: Remove local opal
run: |
rm -rf src/
- name: Test with pytest
run: |
pytest tests/