-
Notifications
You must be signed in to change notification settings - Fork 11
142 lines (141 loc) · 5.42 KB
/
test_weekly.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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
##
## 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.
##
name: Weekly Integration Tests
on:
workflow_dispatch:
inputs:
local:
type: boolean
description: Run test locally (takes long time)
required: true
docker:
type: boolean
description: Run tests in prebuilt docker image (fast)
required: true
schedule:
- cron: "0 12 * * 0" # Sundays @ 12:00
jobs:
test_local:
name: Weekly Tests (Local)
runs-on: ${{ matrix.os }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.local == 'true' }}
strategy:
fail-fast: false
matrix:
python_version:
- "3.10"
os:
- ubuntu-latest
config:
- {branch: main, template: default, path: "tests --ignore tests/integration-tests/toolchains"}
- {branch: develop, template: dev, path: "tests --ignore tests/integration-tests/toolchains"}
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 32768
temp-reserve-mb: 4096
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.config.branch }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- 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 ${{ matrix.config.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: Prepare integration tests
run: |
source .venv/bin/activate
pip install -r requirements_dev.txt
- name: Run integration tests
run: |
source .venv/bin/activate
MLONMCU_HOME=$(pwd)/home/ python3 -m pytest --run-slow --run-user-context ${{ matrix.config.path }} -rs -s -v
test_docker:
name: Weekly Tests (Docker)
runs-on: ubuntu-latest
# container: ${{ matrix.config.image }}
if: ${{ github.event_name == 'schedule' || github.event.inputs.docker == 'true' }}
strategy:
fail-fast: false
matrix:
config:
- {branch: main, image: "tumeda/mlonmcu-bench:latest", path: "tests/unit-tests"}
- {branch: main, image: "tumeda/mlonmcu-bench:latest", path: "tests/integration-tests --ignore tests/integration-tests/toolchains"}
- {branch: develop, image: "tumeda/mlonmcu-bench:dev-develop-latest", path: "tests/unit-tests"}
- {branch: develop, image: "tumeda/mlonmcu-bench:dev-develop-latest", path: "tests/integration-tests --ignore tests/integration-tests/toolchains"}
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
with:
root-reserve-mb: 32768
temp-reserve-mb: 4096
remove-dotnet: 'true'
remove-android: 'true'
remove-haskell: 'true'
remove-codeql: 'true'
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ matrix.config.branch }}
# - name: Run integration tests
# run: |
# python3 -m pytest --run-slow --run-user-context ${{ matrix.config.path }} -rs -s -v
- uses: addnab/docker-run-action@v3
with:
image: ${{ matrix.config.image }}
options: --workdir /home/runner/work/mlonmcu/mlonmcu -v /home/runner/work/mlonmcu/mlonmcu:/home/runner/work/mlonmcu/mlonmcu
shell: bash
run: |
pip install -r requirements_dev.txt
python3 -m pytest --run-slow --run-user-context ${{ matrix.config.path }} -rs -s -v