-
Notifications
You must be signed in to change notification settings - Fork 12
123 lines (116 loc) · 4.61 KB
/
main.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
# This is a basic workflow to help you get started with Actions
name: Test Solver Generation Package
# Controls when the workflow will run
on:
pull_request:
branches:
- main
push:
branches:
- main
- dev
jobs:
basic:
runs-on: ubuntu-20.04
permissions: write-all
env:
LD_LIBRARY_PATH: /home/runner/work/mpc_planner/mpc_planner/acados/lib
ACADOS_SOURCE_DIR: /home/runner/work/mpc_planner/mpc_planner/acados
steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v2
- name: Set up python
id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.8.10
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Cache Acados dependencies
id: cached-acados-dependencies
uses: actions/cache@v3
with:
path: |
acados/
key: acados-${{ runner.os }}-${{ hashFiles('/home/runner/work/mpc_planner/mpc_planner/acados/build/Makefile') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction --no-root
- name: Clone Acados repository
if: steps.cached-acados-dependencies.outputs.cache-hit != 'true'
run: |
git clone https://github.com/acados/acados.git
cd acados
git submodule update --recursive --init
mkdir -p build
cd build
cmake -DACADOS_WITH_QPOASES=ON ..
make install -j4
cd ..
cd bin
wget https://github.com/acados/tera_renderer/releases/download/v0.0.34/t_renderer-v0.0.34-linux
mv t_renderer-v0.0.34-linux t_renderer
chmod +x t_renderer
- name: Link Acados and Poetry
run: |
poetry add -e /home/runner/work/mpc_planner/mpc_planner/acados/interfaces/acados_template
#----------------------------------------------
# run test suite
#----------------------------------------------
# Runs a set of commands using the runners shell
- name: Run pytest
run: PYTHONPATH=src/ poetry run python -m pytest solver_generator/test/ --cov-report=xml:solver_generator/coverage.xml --cov-config=solver_generator/test/.coveragerc --cov --cov-fail-under=70
#----------------------------------------------
# report results with badge
#----------------------------------------------
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
id: coverageComment
with:
pytest-xml-coverage-path: ./solver_generator/coverage.xml
title: Solver Generation
badge-title: solver_generator
hide-badge: false
hide-report: false
create-new-comment: false
hide-comment: false
report-only-changed-files: false
remove-link-from-badge: false
unique-id-for-comment: python3.8.10
- name: Create the Badge
uses: schneegans/[email protected]
with:
auth: ${{ secrets.GIST_SECRET }}
gistID: 8356b652d94441ec2318b597dcf4680d
filename: test.json
label: Coverage Solver Generation
message: ${{ steps.coverageComment.outputs.coverage }}
color: ${{ steps.coverageComment.outputs.color }}
namedLogo: python