Remove nginx dependency #1292
This file contains hidden or 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: Geti Tune Library checks | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - release/** | |
| tags: | |
| - "v*" | |
| pull_request: | |
| merge_group: | |
| branches: | |
| - develop | |
| - release/** | |
| workflow_dispatch: # run on request (no need for PR) | |
| permissions: {} # No permissions by default | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Determines if workflow should execute based on event type and changed paths | |
| # If push or workflow_dispatch -> always run | |
| # If PR or merge_group -> run only if files in specified paths changed | |
| check-paths: | |
| name: Check if workflow should run | |
| runs-on: ubuntu-latest | |
| outputs: | |
| run_workflow: ${{ steps.run_workflow.outputs.run }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Get all paths that should trigger the workflow | |
| id: changed-files-yaml | |
| uses: tj-actions/changed-files@e0021407031f5be11a464abee9a0776171c79891 # v47.0.1 | |
| with: | |
| files_yaml: | | |
| test: | |
| - library/** | |
| - .github/** | |
| - name: Set run flag | |
| id: run_workflow | |
| run: | | |
| if [ "${{ github.event_name }}" = "push" ] || [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "run=true" >> "$GITHUB_OUTPUT" | |
| elif [ "${{ steps.changed-files-yaml.outputs.test_any_changed }}" = "true" ]; then | |
| echo "run=true" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "run=false" >> "$GITHUB_OUTPUT" | |
| fi | |
| code-quality-checks: | |
| runs-on: ubuntu-24.04 | |
| needs: check-paths | |
| if: needs.check-paths.outputs.run_workflow == 'true' | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv and set the Python version | |
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| with: | |
| version: "0.9.7" | |
| enable-cache: false | |
| python-version: "3.10" # Use the lowest supported Python version for linting/type-checking | |
| - name: Installing dependencies | |
| working-directory: library | |
| run: | | |
| uv lock --check | |
| uv sync --frozen | |
| - name: Check formatting with ruff | |
| working-directory: library | |
| run: | | |
| uv run ruff check --output-format=github . | |
| uv run ruff format --check . | |
| # TODO: remove 'continue-on-error' after addressing all mypy issues | |
| # https://github.com/open-edge-platform/training_extensions/issues/5006 | |
| - name: Check source code with mypy | |
| continue-on-error: true | |
| working-directory: library | |
| run: | | |
| uv run mypy src/otx | |
| unit-tests: | |
| runs-on: [self-hosted, linux, x64, dev, dmount] | |
| permissions: | |
| contents: read | |
| # The id-token permission is required by Codecov to use OIDC | |
| id-token: write | |
| needs: | |
| - code-quality-checks | |
| - check-paths | |
| if: needs.check-paths.outputs.run_workflow == 'true' | |
| timeout-minutes: 120 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.13"] | |
| name: unit-tests-with-Python${{ matrix.python-version }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv and set the Python version | |
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| with: | |
| version: "0.9.7" | |
| enable-cache: false | |
| python-version: ${{ matrix.python-version }} | |
| - name: Installing dependencies | |
| working-directory: library | |
| run: | | |
| uv lock --check | |
| uv sync --frozen | |
| - name: Unit testing | |
| working-directory: library | |
| run: uv run pytest tests/unit --cov --cov-report=xml | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 | |
| with: | |
| directory: library | |
| flags: coverage_unit-tests_Python-${{ matrix.python-version }} | |
| use_oidc: true | |
| integration-tests: | |
| runs-on: [self-hosted, linux, x64, dev, dmount] | |
| permissions: | |
| contents: read | |
| needs: | |
| - unit-tests | |
| - check-paths | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ["3.10", "3.13"] | |
| task: | |
| - "multi_class_cls" | |
| - "multi_label_cls" | |
| - "h_label_cls" | |
| - "keypoint_detection" | |
| - "detection" | |
| - "instance_segmentation" | |
| - "semantic_segmentation" | |
| name: integration-tests-${{ matrix.task }}-py${{ matrix.python-version }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv and set the Python version | |
| uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6 | |
| with: | |
| version: "0.9.7" | |
| enable-cache: false | |
| python-version: ${{ matrix.python-version }} | |
| - name: Installing dependencies | |
| working-directory: library | |
| run: | | |
| uv lock --check | |
| uv sync --frozen --extra cuda | |
| - name: Integration testing | |
| working-directory: library | |
| env: | |
| CUBLAS_WORKSPACE_CONFIG: ":4096:8" | |
| run: | | |
| uv run --frozen --extra cuda pytest tests/integration \ | |
| -ra \ | |
| --showlocals \ | |
| --csv=${{ matrix.task }}_Python-${{ matrix.python-version }}.csv \ | |
| --task ${{ matrix.task }} \ | |
| --open-subprocess \ | |
| --run-category-only | |
| required-check: | |
| name: Required Check lib-lint-and-test | |
| needs: | |
| - check-paths | |
| - code-quality-checks | |
| - unit-tests | |
| - integration-tests | |
| runs-on: ubuntu-latest | |
| env: | |
| CHECKS: ${{ join(needs.*.result, ' ') }} | |
| if: always() && !cancelled() | |
| steps: | |
| - name: Check jobs results | |
| run: | | |
| for check in ${CHECKS}; do | |
| echo "::notice::check=${check}" | |
| if [[ "$check" != "success" && "$check" != "skipped" ]]; then | |
| echo "::error ::Required status checks failed. They must succeed before this pull request can be merged." | |
| exit 1 | |
| fi | |
| done |