Skip to content

Commit

Permalink
Merge pull request #31 from MrKevinWeiss/pr/rework/alot
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Big rework
  • Loading branch information
MrKevinWeiss authored Sep 29, 2022
2 parents c57408a + df4c974 commit 1c36556
Show file tree
Hide file tree
Showing 119 changed files with 12,346 additions and 3,514 deletions.
21 changes: 21 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .coveragerc to control coverage.py
[run]
branch = True
source = memory_map_manager/

[report]
# A list of regular expressions. Any line that matches one of these regexes is excluded from being reported as missing
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain if non-runnable code isn't run:
if __name__ == .__main__.:

# (integer): the number of digits after the decimal point to display for reported coverage percentages.
precision = 1


[html]
# (string, default "htmlcov"): where to write the HTML report files.
directory = htmlcov
3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
exclude = .tox,dist,doc,build,*.egg
max-complexity = 10
98 changes: 98 additions & 0 deletions .github/workflows/ctest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
name: CMake Build Matrix

on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master

env:
CMAKE_VERSION: 3.23.0

jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
apps:
- examples/minimal

steps:
- uses: actions/checkout@v2

- name: Download CMake
shell: cmake -P {0}
run: |
set(cmake_version $ENV{CMAKE_VERSION})
message(STATUS "Using host CMake version: ${CMAKE_VERSION}")
set(cmake_suffix "linux-x86_64.tar.gz")
set(cmake_dir "cmake-${cmake_version}-linux-x86_64/bin")
set(cmake_url "https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-${cmake_suffix}")
file(DOWNLOAD "${cmake_url}" ./cmake.zip SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xvf ./cmake.zip)
# Add to PATH environment variable
file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/${cmake_dir}" cmake_dir)
set(path_separator ":")
file(APPEND "$ENV{GITHUB_PATH}" "$ENV{GITHUB_WORKSPACE}${path_separator}${cmake_dir}")
execute_process(
COMMAND chmod +x ${cmake_dir}/cmake
)
- name: Configure
shell: cmake -P {0}
run: |
set(ENV{CC} gcc)
set(ENV{CXX} g++)
set(path_separator ":")
set(ENV{PATH} "$ENV{GITHUB_WORKSPACE}${path_separator}$ENV{PATH}")
execute_process(
COMMAND cmake
-S .
-B build
WORKING_DIRECTORY ${{ matrix.apps }}
RESULT_VARIABLE result
)
if (NOT result EQUAL 0)
message(FATAL_ERROR "Bad exit status")
endif()
- name: Build
shell: cmake -P {0}
run: |
execute_process(
COMMAND cmake --build build
WORKING_DIRECTORY ${{ matrix.apps }}
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE output
ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE
)
if (NOT result EQUAL 0)
string(REGEX MATCH "FAILED:.*$" error_message "${output}")
string(REPLACE "\n" "%0A" error_message "${error_message}")
message("::error::${error_message}")
message(FATAL_ERROR "Build failed")
endif()
- name: Run tests
shell: cmake -P {0}
run: |
include(ProcessorCount)
ProcessorCount(N)
set(ENV{CTEST_OUTPUT_ON_FAILURE} "ON")
execute_process(
COMMAND ctest -j ${N}
WORKING_DIRECTORY ${{ matrix.apps }}/build
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE output
ECHO_OUTPUT_VARIABLE ECHO_ERROR_VARIABLE
)
if (NOT result EQUAL 0)
string(REGEX MATCH "[0-9]+% tests.*[0-9.]+ sec.*$" test_results "${output}")
string(REPLACE "\n" "%0A" test_results "${test_results}")
message("::error::${test_results}")
message(FATAL_ERROR "Running tests failed!")
endif()
40 changes: 40 additions & 0 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Run on Examples

on:
push:
branches:
- master
tags:
- '*'
pull_request:
branches:
- master

jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
configs:
- examples/minimal/main.yaml
- examples/complex/mp1.yaml
- examples/complex/mp2.yaml
- examples/complex/sa.yaml
- examples/complex/sensor.yaml
- examples/full/main.yaml
- examples/minimal/main.yaml
- examples/philip/main.yaml

steps:
- uses: actions/checkout@v1
- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
- name: Generate example
run: mmm-gen -p ${{ matrix.configs }}
26 changes: 13 additions & 13 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
max-parallel: 5
max-parallel: 4
matrix:
python-version: [3.5, 3.6, 3.7, 3.8, 3.9]
python-version: ['3.7', '3.8', '3.9', '3.10']

steps:
- uses: actions/checkout@v1
Expand All @@ -30,13 +30,13 @@ jobs:
pip install tox tox-gh-actions
- name: Test with tox
run: tox
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
if: >-
matrix.python-version == 3.9 &&
github.event_name == 'push' &&
startsWith(github.event.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: .tox/dist/
# - name: Publish package to PyPI
# uses: pypa/gh-action-pypi-publish@master
# if: >-
# matrix.python-version == 3.10 &&
# github.event_name == 'push' &&
# startsWith(github.event.ref, 'refs/tags')
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}
# packages_dir: .tox/dist/
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,18 @@ __pycache__
.benchmarks
.tox
.coverage
.venv
.vscode

# CMake
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps
Loading

0 comments on commit 1c36556

Please sign in to comment.