Skip to content

Commit

Permalink
Merge branch 'rc-v0.5.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
madcowswe committed Sep 27, 2020
2 parents e9cd716 + feb866c commit f360f57
Show file tree
Hide file tree
Showing 158 changed files with 24,756 additions and 3,050 deletions.
117 changes: 117 additions & 0 deletions .github/workflows/compile.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Tests

on:
pull_request:
branches: [master, devel]
tags: ['fw-v*']
push:
branches: [master, devel]
tags: ['fw-v*']

jobs:
compile:
strategy:
fail-fast: false
matrix:
os: [ubuntu-16.04, ubuntu-latest, windows-latest, macOS-latest]
board_version: [v3.6-56V]
debug: [true]

include:
- {os: ubuntu-latest, board_version: v3.2, debug: false}
- {os: ubuntu-latest, board_version: v3.3, debug: false}
- {os: ubuntu-latest, board_version: v3.4-24V, debug: false}
- {os: ubuntu-latest, board_version: v3.4-48V, debug: false}
- {os: ubuntu-latest, board_version: v3.5-24V, debug: false}
- {os: ubuntu-latest, board_version: v3.5-48V, debug: false}
- {os: ubuntu-latest, board_version: v3.6-24V, debug: false}
- {os: ubuntu-latest, board_version: v3.6-56V, debug: false}

runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2

- name: Install prerequisites (Debian)
if: startsWith(matrix.os, 'ubuntu-')
run: |
DEBIAN_VERSION="$(lsb_release --release --short)"
echo Debian version: $DEBIAN_VERSION
if [ "$DEBIAN_VERSION" -gt 9 ]; then
sudo apt-get install gcc-arm-none-eabi
else
# Ubuntu 16.04 (Debian 9) is on ARM GCC 4.9 which is too old for us
sudo add-apt-repository ppa:team-gcc-arm-embedded/ppa
sudo apt-get update
sudo apt-get install gcc-arm-embedded
fi
if ! (apt-cache search tup | grep "^tup - "); then
sudo add-apt-repository ppa:jonathonf/tup
sudo apt-get update
fi
sudo apt-get install tup
sudo apt install python3 python3-yaml python3-jinja2 python3-jsonschema
- name: Install prerequisites (macOS)
if: startsWith(matrix.os, 'macOS-')
run: |
brew install armmbed/formulae/arm-none-eabi-gcc
brew cask install osxfuse && brew install tup
pip3 install PyYAML Jinja2 jsonschema
- name: Cache chocolatey
uses: actions/cache@v2
if: startsWith(matrix.os, 'windows-')
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey\gcc-arm-embedded
key: ${{ runner.os }}-gcc-arm-embedded
restore-keys: |
${{ runner.os }}-gcc-arm-embedded
- name: Install prerequisites (Windows)
if: startsWith(matrix.os, 'windows-')
run: |
Invoke-WebRequest -Uri "http://gittup.org/tup/win32/tup-latest.zip" -OutFile ".\tup-latest.zip"
Expand-Archive ".\tup-latest.zip" -DestinationPath ".\tup-latest" -Force
echo "::add-path::$(Resolve-Path .)\tup-latest"
choco install gcc-arm-embedded # downloads https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-win32.zip
pip install PyYAML Jinja2 jsonschema
- name: Prepare Compilation
run: |
# for debugging
arm-none-eabi-gcc --version
python --version
cd ${{ github.workspace }}/Firmware
echo "CONFIG_BOARD_VERSION=${{ matrix.board_version }}" >> tup.config
echo "CONFIG_STRICT=true" >> tup.config
echo "CONFIG_DEBUG=${{ matrix.release }}" >> tup.config
tup init
tup generate ./tup_build.sh
- name: Compile (Unix)
if: "!startsWith(matrix.os, 'windows-')"
run: |
cd ${{ github.workspace }}/Firmware
bash -xe ./tup_build.sh
- name: Compile (Windows)
if: startsWith(matrix.os, 'windows-')
run: |
cd ${{ github.workspace }}/Firmware
mv tup_build.sh tup_build.bat # in reality this is a .bat script on windows
.\tup_build.bat
#code-checks:
# runs-on: ubuntu-latest
# steps:
# TODO:
# - check if enums.py is consistent with yaml
# - clang-format check
# - check if interface_generator outputs the same thing with Python 3.5 and Python 3.8
67 changes: 67 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build and publish HTML documentation website

on:
push:
branches: [ feature/doc_autogen ]

jobs:
jekyll:
runs-on: ubuntu-16.04
steps:
- uses: actions/checkout@v2

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'

# Use GitHub Actions' cache for ruby and python packages to shorten build times and decrease load on servers
- name: Cache gems
uses: actions/cache@v2
with:
path: docs/vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('docs/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-PyYAML-Jinja2-jsonschema
restore-keys: |
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Python dependencies
run: pip install PyYAML Jinja2 jsonschema

# Autogenerate the API reference .md files in the python in the python/python3 container
- name: Autogenerate the API reference .md files in the python container
run: |
mkdir -p docs/_api docs/_includes
python Firmware/interface_generator_stub.py --definitions Firmware/odrive-interface.yaml --template docs/_layouts/api_documentation_template.j2 --outputs docs/_api/#.md
python Firmware/interface_generator_stub.py --definitions Firmware/odrive-interface.yaml --template docs/_layouts/api_index_template.j2 --output docs/_includes/apiindex.html
- name: Build the site in the jekyll/builder container
run: |
docker run \
-v ${{ github.workspace }}:/srv/jekyll -e PAGES_REPO_NWO=${GITHUB_REPOSITORY} \
ruby:2.7-buster /bin/sh -c "
chmod 777 /srv/jekyll/docs && \
cd /srv/jekyll/docs && \
bundle config path vendor/bundle && \
bundle install && \
JEKYLL_ENV=production bundle exec jekyll build
"
touch .nojekyll
- name: Push to documentation branch
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git add -f docs/_site
git commit -m "jekyll build from Action ${GITHUB_SHA}"
git push --force origin HEAD:${REMOTE_BRANCH}
env:
REMOTE_BRANCH: gh-pages
34 changes: 34 additions & 0 deletions .github/workflows/nightly.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: pip install odrive (nightly)

on:
schedule:
- cron: '0 2 * * *' # run at 2 AM UTC

jobs:
nightly:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
#pip: [pip2, pip3]

runs-on: ${{ matrix.os }}
steps:
- name: Install odrivetool
run: |
pip install monotonic # TODO: this is dishonest. Must be removed as soon as v0.5.0 is published!
pip install odrive
# This one currently fails because Github Actions runs pip as non-root
#- name: Check if udev rules were set up properly
# if: matrix.os == 'ubuntu-latest'
# run: test -f /etc/udev/rules.d/91-odrive.rules

# This step is mentioned in the user guide
- name: Add ~/.local/bin to path
if: matrix.os == 'ubuntu-latest'
run: echo "::add-path::~/.local/bin"

- name: Launch odrivetool
# This returns a non-zero exit code if the odrivetool throws an exception
run: echo 'quit()' | odrivetool shell
37 changes: 31 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ coverage.xml
# Django stuff:
*.log

# Sphinx documentation
docs/_build/

# PyBuilder
target/

Expand All @@ -37,7 +34,35 @@ target/
.tup
tup.config

/ruby-bundle
/_site
/.bundle
# Sphinx documentation
/docs/_build/

# Autogenerated API reference
/docs/_api
/docs/_includes/apiindex.html

# Jekyll HTML documention and artifacts
/docs/ruby-bundle
/docs/_site
/docs/.bundle/config
/docs/.jekyll-metadata


*.exe

ODrive\.config

ODrive\.creator

ODrive\.creator\.user

ODrive\.files

ODrive\.includes

Firmware/Tests/bin/

# GUI
GUI/dist_electron
GUI/node_modules
GUI/build
70 changes: 0 additions & 70 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Arduino/ODriveArduino/ODriveArduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ bool ODriveArduino::run_state(int axis, int requested_state, bool wait) {
do {
delay(100);
serial_ << "r axis" << axis << ".current_state\n";
} while (readInt() != AXIS_STATE_IDLE && --timeout_ctr > 0);
} while (readInt() != requested_state && --timeout_ctr > 0);
}

return timeout_ctr > 0;
Expand Down
Loading

0 comments on commit f360f57

Please sign in to comment.