feat: replace poetry with uv #517
Workflow file for this run
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
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: Install python dependencies | |
run: | | |
uv venv | |
uv pip install -r pyproject.toml | |
- name: Run python linter | |
run: uv run ruff check render_templates | |
if: ${{ !cancelled() }} | |
- name: Run python formatter | |
run: uv run ruff format --check render_templates | |
if: ${{ !cancelled() }} | |
- name: Run tests and coverage | |
run: uv run pytest render_templates | |
if: ${{ !cancelled() }} | |
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: uv run python3 -m render_templates.main --flavor ${{ matrix.flavor }} | |
- 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 . |