CuPy and Pytorch utils imp #168
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Lints the code of a branch | ||
name: Linting pipeline | ||
on: | ||
workflow_call: | ||
jobs: | ||
lint-cpp: | ||
runs-on: self-hosted | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
id: cpp | ||
steps: | ||
- name: C++ lint | ||
uses: cpp-linter/cpp-linter-action@v2 | ||
with: | ||
style: "file" | ||
tidy-checks: "" | ||
thread-comments: ${{ github.event_name == 'pull_request' && 'update' }} | ||
lint-python: | ||
runs-on: self-hosted | ||
permissions: | ||
checks: write | ||
pull-requests: write | ||
id: python | ||
steps: | ||
- name: Lint with pylint | ||
run: | | ||
pylint --disable=C0301 --disable=C0326 *.py | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Check for linting errors | ||
id: lint-check | ||
run: | | ||
if [ -f lint-results.txt ]; then | ||
echo "Linting issues found" | ||
cat lint-results.txt | ||
exit 1 | ||
else | ||
echo "No linting issues found" | ||
fi | ||
update-pr: | ||
run: | | ||
git config user.name "github-actions" | ||
git config user.email "[email protected]" | ||
if [[ $(git status --porcelain) ]]; then | ||
git add . | ||
git commit -m "Auto-fix lint issues" | ||
git push origin HEAD:${{ github.head_ref }} | ||
else | ||
echo "No lint fixes applied, nothing to commit." | ||
fi | ||
# bug checks | ||
# compilation | ||
# linting/formatting | ||
# Ament_flake8 | ||
# Ament_lint_cmake | ||
# Ament_xmllint | ||
# Black | ||
# Clang-tidy | ||
# Isort |