Skip to content

Run Benchmarks

Run Benchmarks #9

Workflow file for this run

##
## 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: Run Benchmarks
on:
workflow_dispatch:
inputs:
template:
description: 'MLonMCU Environment Template'
required: true
default: "default"
benchmark:
description: 'Benchmark Name'
required: true
default: ""
jobs:
benchmark:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
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 rsync
sudo apt -qq install -y ninja-build flex
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: Run Benchmark
run: |
source .venv/bin/activate
export MLONMCU_HOME=$(pwd)/home
cd scripts/
python bench.py ${{ github.event.inputs.benchmark }} out/
- name: Archive reports
uses: actions/upload-artifact@v2
with:
name: results
path: scripts/out/
- name: Get date
run: echo "timestamp=`date +%FT%T`" >> $GITHUB_ENV
- name: Upload results to a special branch
uses: JamesIves/[email protected]
with:
folder: scripts/out/
branch: benchmark_results
target-folder: benchmarks/${{ github.event.inputs.benchmark }}/${{ env.timestamp }}/