Skip to content

[C] update onnx metadata functions #62

[C] update onnx metadata functions

[C] update onnx metadata functions #62

Workflow file for this run

name: Pull Request
on:
pull_request:
branches: [main]
paths-ignore:
- "**/version.h"
- "doc/**"
- "**.md"
env:
LOCAL_REGISTRY: localhost:5000
DOCKERFILE: docker/pr.dockerfile
jobs:
get_runner_and_uid:
name: Get Runner
runs-on: [self-hosted, unicorn]
steps:
- name: Get UID and GID
id: uid_gid
run: |
echo "uid_gid=$(id -u):$(id -g)" >> "$GITHUB_OUTPUT"
outputs:
runner: ${{ runner.name }}
uid: ${{ steps.uid_gid.outputs.uid_gid }}
build_docker_image:
name: Build Docker Image
needs: [get_runner_and_uid]
runs-on: ${{ needs.get_runner_and_uid.outputs.runner }}
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Build Docker Image
id: docker_build
uses: docker/build-push-action@v3
with:
file: ${{ env.DOCKERFILE }}
no-cache: false
push: true
tags: ${{ env.LOCAL_REGISTRY }}/capybara-container:ci
outputs:
image: ${{ env.LOCAL_REGISTRY }}/capybara-container:ci
ci:
name: CI
needs: [get_runner_and_uid, build_docker_image]
runs-on: ${{ needs.get_runner_and_uid.outputs.runner }}
strategy:
matrix:
python-version:
- "3.10"
container:
image: ${{ needs.build_docker_image.outputs.image }}
options: --user ${{ needs.get_runner_and_uid.outputs.uid }} --gpus all
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Dependencies
run: |
python3 -m pip install pytest wheel pylint pylint-flask pytest-cov typeguard
- name: Build and Install Package
run: |
python3 setup.py bdist_wheel && \
wheel_file=$(ls dist/*.whl 2>/dev/null || echo '') && \
if [ -z "$wheel_file" ]; then
echo 'Error: No wheel file found in dist directory.' && exit 1
fi && \
python3 -m pip install $wheel_file --force-reinstall
- name: Lint with Pylint
run: |
python3 -m pylint capybara \
--rcfile=.github/workflows/.pylintrc \
--load-plugins pylint_flask
- name: Run Tests with Pytest
run: |
mkdir -p tests/coverage && \
python3 -m pytest tests --junitxml=tests/coverage/cov-junitxml.xml \
--cov=capybara | tee tests/coverage/cov.txt
- name: Pytest Coverage Comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
pytest-coverage-path: tests/coverage/cov.txt
junitxml-path: tests/coverage/cov-junitxml.xml