Skip to content

Commit

Permalink
Merge pull request #100 from hungpham2511/release-v0.3.0
Browse files Browse the repository at this point in the history
Release v0.3.0
  • Loading branch information
hungpham2511 authored May 3, 2020
2 parents 60fcfe2 + 96ad8dc commit e72b40b
Show file tree
Hide file tree
Showing 105 changed files with 5,010 additions and 822 deletions.
28 changes: 28 additions & 0 deletions .circleci/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# CI

We have the following CI workflows in CirclCI.

## integrate

The main workflow for new commits. The following jobs are done:
- Check project codestyle.
- Build and test toppra on Python 3.
- Build and test toppra (C++).

## release

Check release branch for proper version.


## publish

Publish source code to venues (PyPI). NOTE: This is currently not done.


# Github Action
Some tasks are done directly with Github Action.

- Linting for C++ code with clang-tidy.

Note: `cppcoreguidelines-pro-bounds-array-to-pointer-decay` leads to false reported error, thus disabled.

65 changes: 32 additions & 33 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
version: 2

jobs:
check-codestyle:
docker:
Expand Down Expand Up @@ -34,7 +35,7 @@ jobs:
path: test-reports
destination: test-reports

test-python-3:
build-python-3:
docker:
- image: hungpham2511/toppra-dep:0.0.3

Expand All @@ -51,7 +52,7 @@ jobs:
- run:
name: install dependencies
command: |
python3 -m virtualenv --python python3 venv3 && . venv3/bin/activate
virtualenv --python python3.7 venv3 && . venv3/bin/activate
pip install invoke pathlib2 numpy cython
invoke install-solvers
pip install -e .[dev]
Expand All @@ -66,53 +67,45 @@ jobs:
command: |
. venv3/bin/activate
mkdir test-reports
pytest -q tests --durations=3 --junitxml=test-reports/junit.xml
python --version
python -m pytest -q tests --durations=3 --junitxml=test-reports/junit.xml
- store_test_results:
path: test-reports

test-python-2:
build-cpp:
docker:
- image: hungpham2511/toppra-dep:0.0.3

working_directory: ~/repo

steps:
- checkout
- restore_cache:
keys:
- v1-dependencies2-{{ checksum "requirements.txt" }}

- run:
name: install dependencies
name: dependencies
command: |
python -m pip install virtualenv --user
python -m virtualenv venv && . venv/bin/activate
python -m pip install invoke pathlib2 numpy cython
python -m invoke install-solvers
pip install -e .[dev]
- save_cache:
paths:
- ./venv
key: v1-dependencies2-{{ checksum "requirements.txt" }}
sudo apt install -y curl
echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg" \
| sudo tee /etc/apt/sources.list.d/robotpkg.list
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key \
| sudo apt-key add -
sudo apt update
sudo apt install -y clang-tidy libeigen3-dev robotpkg-pinocchio robotpkg-qpoases libglpk-dev
- run:
name: test
name: build
command: |
. venv/bin/activate
export PYTHONPATH=$PYTHONPATH:`openrave-config --python-dir`
mkdir test-reports
pytest --durations=3 --junitxml=test-reports/junit.xml
export LD_LIBRARY_PATH=/opt/openrobots/lib:${LD_LIBRARY_PATH}
export CMAKE_PREFIX_PATH=/opt/openrobots
mkdir build && cd build && cmake -DBUILD_WITH_PINOCCHIO=ON -DBUILD_WITH_qpOASES=ON -DBUILD_WITH_GLPK=ON ..
make -j4
working_directory: ~/repo/cpp

- run:
name: Collect log data
name: test
command: |
cp /tmp/toppra.log ~/repo/test-reports/
- store_test_results:
path: test-reports
destination: test-reports
./tests/all_tests
working_directory: ~/repo/cpp/build

pre-release:
docker:
Expand Down Expand Up @@ -147,11 +140,14 @@ jobs:
workflows:
version: 2
test-and-lint:
integrate:
jobs:
- test-python-2
- test-python-3
- build-cpp
- check-codestyle
- build-python-3:
requires:
- check-codestyle

release:
jobs:
- pre-release:
Expand All @@ -160,6 +156,9 @@ workflows:
only:
- fix-ci
- /release-.*/

publish:
jobs:
- release:
filters:
branches:
Expand Down
117 changes: 117 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 88
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
RawStringFormats:
- Delimiter: pb
Language: TextProto
BasedOnStyle: google
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
...

25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: 'Type: bug'
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1.
2.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Version**
Branch, commit, version?
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Fixes #

Changes in this PRs:
-
-

Checklists:
- [ ] Update CHANGELOG.md with a single line describing this PR
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Lint (C++, clang-tidy)

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:
lint:
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Install deps
run: |
sudo apt install -y curl
echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg" \
| sudo tee /etc/apt/sources.list.d/robotpkg.list
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key \
| sudo apt-key add -
sudo apt update
sudo apt install -y clang-tidy libeigen3-dev robotpkg-pinocchio robotpkg-qpoases
- name: Lint
run: |
cd $GITHUB_WORKSPACE/cpp
export LD_LIBRARY_PATH=/opt/openrobots/lib:${LD_LIBRARY_PATH}
export CMAKE_PREFIX_PATH=/opt/openrobots
mkdir build && cd build && cmake -DBUILD_WITH_PINOCCHIO=ON -DBUILD_WITH_qpOASES=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1 ..
clang-tidy src/**/*.cpp \
-checks=clang-analyzer-*,clang-analyzer-cplusplus*,cppcoreguidelines-*,performance-*,modernize-*,readability-,-cppcoreguidelines-pro-bounds-array-to-pointer-decay\
-warnings-as-errors=clang-analyzer-*,clang-analyzer-cplusplus*,cppcoreguidelines-*,modernize-*
Empty file added .gitmodules
Empty file.
1 change: 1 addition & 0 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ disable=
xrange-builtin,
xreadlines-attribute,
zip-builtin-not-iterating,
bad-continuation

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down
Loading

0 comments on commit e72b40b

Please sign in to comment.