Skip to content

Feat/fix face depth #34

Feat/fix face depth

Feat/fix face depth #34

Workflow file for this run

name: Pull Request for Ubuntu with GPU
on:
pull_request:
branches: [main]
paths-ignore:
- "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 }}/pyface-container:ci
outputs:
image: ${{ env.LOCAL_REGISTRY }}/pyface-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
with:
lfs: true
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- 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 --universal && \
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 pyface --rcfile=.github/workflows/.pylintrc
- name: Run tests with pytest
run: |
mkdir -p tests/coverage
python -m pip install pytest pytest-cov typeguard
python -m pytest tests --junitxml=tests/coverage/cov-junitxml.xml --cov=pyface
- name: Surface failing tests
uses: pmeier/pytest-results-action@main
with:
path: tests/coverage/cov-junitxml.xml
summary: true
display-options: fEX
fail-on-empty: true
title: Test results
- name: Clean artifacts
run:
rm -rf dist wheelhouse build *.egg-info
- name: Clean workspace when fail
if: failure()
run:
rm -rf ${{ github.workspace }}