Skip to content

feat: replace poetry with uv #514

feat: replace poetry with uv

feat: replace poetry with uv #514

Workflow file for this run

name: Test suites
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
python-unit-tests:
name: Tests renderer
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version-file: pyproject.toml
- name: Run python linter
run: ruff check render_templates
if: ${{ !cancelled() }}
env:
VIRTUAL_ENV: ./.venv
- name: Run python formatter
run: ruff format --check render_templates
if: ${{ !cancelled() }}
env:
VIRTUAL_ENV: ./.venv
- name: Run tests and coverage
run: pytest render_templates
if: ${{ !cancelled() }}
env:
VIRTUAL_ENV: ./.venv
Linter:
name: Run linters
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
flavor: ["armnn", "cpu", "cuda", "noml", "openvino"]
steps:
- uses: actions/checkout@v4
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv python install
- name: Install python dependencies
run: uv pip install -r pyproject.toml
- name: Create Dockerfile from template
run: python3 -m render_templates.main --flavor ${{ matrix.flavor }}
env:
VIRTUAL_ENV: ./.venv
- name: Run Hadolint
uses: hadolint/[email protected]
if: ${{ !cancelled() }}
with:
dockerfile: build-${{ matrix.flavor }}/Dockerfile
- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
if: ${{ !cancelled() }}
with:
scandir: build-${{ matrix.flavor }}
additional_files: "run"
- name: Check Permissions
if: ${{ !cancelled() }}
run: |
WRONG_PERM=$(find ./build-${{ matrix.flavor }} -path "./.git" -prune -o \( -name "run" -o -name "finish" -o -name "check" \) -not -perm -u=x,g=x,o=x -print)
if [ -n "${WRONG_PERM}" ]; then
for i in ${WRONG_PERM}; do
echo "::error file=${i},line=1,title=Missing Executable Bit::This file needs to be set as executable!"
done
exit 1
else
echo "**** All perms look good ****"
fi
format:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install prettier
run: npm i [email protected]
- name: Run formatter
run: npx prettier --check .