Skip to content

Fix template path, use poetry to manage dependencies #138

Fix template path, use poetry to manage dependencies

Fix template path, use poetry to manage dependencies #138

Workflow file for this run

name: test_python_pkg
on: [push, pull_request]
jobs:
test_on_ubuntu_latest:
runs-on: ubuntu-latest
strategy:
matrix:
python-version_ubuntu-latest: ["3.10", 3.11]
steps:
- uses: actions/[email protected]
- name: Set up Python ${{ matrix.python-version_ubuntu-latest }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python-version_ubuntu-latest }}
- name: Install dependencies
run: python -m pip install --upgrade pip setuptools wheel
- name: create folder, venv and activate
run: |
mkdir -p src/ros2model/
rsync -av --exclude='src' --exclude='.git' ./ src/ros2model/
python3 -m venv venv --system-site-packages --symlinks
ls
. venv/bin/activate
echo PATH=$PATH >> $GITHUB_ENV
- name: Install deps via poetry
run: |
pip install poetry
poetry install -C src/ros2model/
- name: install pytest pytest-cov
run: |
pip install pytest pytest-cov
- name: Test with pytest
run: |
export COVERAGE=true
cd src/ros2model/
./test.sh
shell: bash
lint:
name: pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: 3.x
- name: install pre-commit
run: pip install pre-commit
- name: pre-commit cache
uses: actions/[email protected]
with:
path: ~/.cache/pre-commit
key: "${{ hashFiles('.pre-commit-config.yaml') }}"
- run: pre-commit run --all-files --show-diff-on-failure