-
Notifications
You must be signed in to change notification settings - Fork 12
123 lines (121 loc) · 3.92 KB
/
demo.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
122
123
##
## Copyright (c) 2022 TUM Department of Electrical and Computer Engineering.
##
## This file is part of MLonMCU.
## See https://github.com/tum-ei-eda/mlonmcu.git for further info.
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## http://www.apache.org/licenses/LICENSE-2.0
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.
##
# ML on MCU demonstration (also serves as end-to-end testj
# TODO: provide docker image with apt packages
name: Usage Demo
on:
workflow_dispatch:
inputs:
# template:
# type: choice
# description: Environment Template
# options:
# - default
# - minimal
# required: true
template:
type: string
description: Environment Template
default: default
required: true
test:
type: boolean
description: Run long integration tests
required: true
artifact:
type: boolean
description: Upload artifacts
required: true
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
jobs:
demo:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# TODO: caching
- name: Install APT packages
run: |
sudo apt -qq install -y g++ libboost-all-dev libboost-system-dev libboost-filesystem-dev libboost-program-options-dev graphviz doxygen libtinfo-dev zlib1g-dev texinfo unzip device-tree-compiler
sudo apt -qq install -y ninja-build
sudo apt remove clang-11* llvm-11*
- name: Initialize Virtualenv
run: |
python -m pip install --upgrade pip
python -m venv .venv
- name: Install dependencies
run: |
source .venv/bin/activate
pip install -r requirements.txt
- name: Run package creation
run: |
source .venv/bin/activate
make install
- name: Initialize MLonMCU environment
run: |
source .venv/bin/activate
mlonmcu init home/ --non-interactive --template ${{ github.event.inputs.template }}
- name: Setup MLonMCU dependencies
run: |
source .venv/bin/activate
mlonmcu setup -H home/ -v
- name: Install environment-specific Python packages
run: |
source .venv/bin/activate
MLONMCU_HOME=$(pwd)/home/ mlonmcu setup -g
pip install -r home/requirements_addition.txt
- name: Run MLonMCU flow
run: |
source .venv/bin/activate
mlonmcu flow run sine_model -H home/ -v
mlonmcu export -H home/ session.zip
- name: Prepare complex integration tests (optional)
run: |
source .venv/bin/activate
pip install -r requirements_dev.txt
if: ${{ github.event.inputs.test == 'true' }}
- name: Run complex integration tests (optional)
run: |
source .venv/bin/activate
MLONMCU_HOME=$(pwd)/home/ make test-full
if: ${{ github.event.inputs.test == 'true' }}
- name: Remove dependencies (too large for artifact)
run: |
source .venv/bin/activate
mlonmcu cleanup -H home/ -f --deps
if: ${{ github.event.inputs.artifact == 'true' }}
- name: Archive environment (without deps)
uses: actions/upload-artifact@v2
with:
name: mlonmcu_home
path: home/
if: ${{ github.event.inputs.artifact == 'true' }}