Python(feat): hierarchical pytest report tree (packages, modules, classes, parametrize) #2690
Workflow file for this run
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: python-ci | |
| on: | |
| release: | |
| types: [ created ] | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'python/**' | |
| - 'rust/crates/sift_stream_bindings/**' | |
| - '.github/workflows/python_ci.yaml' | |
| workflow_call: | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| changes: | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| outputs: | |
| python: ${{ steps.filter.outputs.python }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: | | |
| python: | |
| - 'python/**' | |
| - 'rust/crates/sift_stream_bindings/**' | |
| - '.github/workflows/python_ci.yaml' | |
| test-python: | |
| needs: [changes] | |
| if: | | |
| always() && | |
| (github.event_name != 'pull_request' || needs.changes.outputs.python == 'true') | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: python | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v2 | |
| with: | |
| python-version: "3.8" | |
| - name: Pip install | |
| id: install | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install '.[dev-all]' | |
| - name: Lint | |
| run: | | |
| ruff check | |
| - name: Format | |
| run: | | |
| ruff format --check | |
| - name: MyPy | |
| run: | | |
| mypy lib | |
| - name: Pyright | |
| run: | | |
| pyright lib | |
| - name: Check Stubs Generation | |
| working-directory: . | |
| run: | | |
| bash .githooks/pre-push-python/stubs.sh | |
| - name: Check Extras Generation | |
| working-directory: . | |
| run: | | |
| bash .githooks/pre-push-python/extras.sh | |
| - name: Pytest Unit Tests | |
| run: | | |
| pytest -m "not integration" | |
| # Disabling integration tests that interact with Sift until a better solution is implemented | |
| # - name: Pytest Integration Tests | |
| # env: | |
| # SIFT_GRPC_URI: ${{ vars.SIFT_GRPC_URI }} | |
| # SIFT_REST_URI: ${{ vars.SIFT_REST_URI }} | |
| # SIFT_API_KEY: ${{ secrets.SIFT_API_KEY }} | |
| # run: | | |
| # pytest -m "integration" | |
| - name: Sync Stubs Mypy | |
| working-directory: python/lib | |
| run: | | |
| stubtest \ | |
| --mypy-config-file ../pyproject.toml \ | |
| sift_client.resources.sync_stubs | |
| python-ci-status: | |
| if: always() | |
| needs: [changes, test-python] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check result | |
| run: | | |
| result="${{ needs.test-python.result }}" | |
| if [[ "$result" == "success" || "$result" == "skipped" ]]; then | |
| echo "python-ci passed (test-python: $result)" | |
| else | |
| echo "python-ci failed (test-python: $result)" | |
| exit 1 | |
| fi |