Skip to content

Remove dependency on OTX #758

Remove dependency on OTX

Remove dependency on OTX #758

Workflow file for this run

name: Pre-merge tests
# Controls when the action will run. This action can be triggered manually
# (workflow_dispatch trigger), and it will be run automatically when a PR to main is made.
on:
workflow_dispatch:
pull_request:
branches:
- main
env:
PREMERGE_TEST_REPORT: pre_merge_test_report.html
REPORT_DIRECTORY: reports
PYTHONUTF8: '1'
permissions:
contents: read
checks: read
actions: read
jobs:
pr_tests:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
os: [ubuntu-latest, windows-latest, macos-latest]
exclude: # Disabled due to `shapely` package issue (otx dependency)
- os: macos-latest
python-version: '3.10'
- os: windows-latest
python-version: '3.10'
include: # Run test with legacy cassette (Currently - Geti 1.8)
- os: ubuntu-22.04
python-version: '3.10'
env: GETI_PLATFORM_VERSION=LEGACY
fail-fast: true
max-parallel: 3
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install package with dev and notebook requirements
run: |
python -m pip install --upgrade pip
pip install ".[dev,notebooks]"
- name: Create report directory
# Creates the temporary directory that is used to store the test report
run: |
mkdir -p env.REPORT_DIRECTORY
- name: Check formatting with black
run: black . --check
- name: Check imports with isort
run: isort . --check
if: ${{ always() }}
- name: Flake8 linting
run: flake8 .
if: ${{ always() }}
- name: Pydocstyle linting
run: pydocstyle geti_sdk --count
if: ${{ always() }}
- name: Test with pytest
run: |
pytest tests/pre-merge -c tests/offline.ini --cov=geti_sdk --html=env.REPORT_DIRECTORY/env.PREMERGE_TEST_REPORT --self-contained-html --cov-report html:env.REPORT_DIRECTORY/coverage
- name: Upload test report for pre-merge tests
# Publish the test report to github
uses: actions/upload-artifact@v3
if: ${{ always() }}
with:
name: pre-merge-test-reports
path: ${{ env.REPORT_DIRECTORY }}
- name: Clean up report directories
# Remove temporary report directory
if: ${{ always() }}
run: |
rm -r env.REPORT_DIRECTORY