name: Test Python on: pull_request: branches: - main paths: - dbgpt/** - pilot/meta_data/** - .github/workflows/test-python.yml push: branches: - main paths: - dbgpt/** - pilot/meta_data/** - .github/workflows/test-python.yml concurrency: group: ${{ github.event.number || github.run_id }} cancel-in-progress: true #permissions: # contents: read # pull-requests: write # jobs: test-python: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: # TODO: Add windows-latest support os: [ubuntu-latest, macos-latest] python-version: ["3.10", "3.11"] steps: - uses: actions/checkout@v4 - name: Set up Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python -m pip install --upgrade pip pip install -e ".[openai]" pip install -r requirements/dev-requirements.txt - name: Run tests run: | pytest dbgpt --cov=dbgpt --cov-report=xml:coverage-${{ matrix.python-version }}-${{ matrix.os }}.xml --cov-report=html:htmlcov-${{ matrix.python-version }}-${{ matrix.os }} --junitxml=pytest_report-${{ matrix.python-version }}-${{ matrix.os }}.xml - name: Generate coverage report summary if: matrix.os == 'ubuntu-latest' id: cov-report run: | coverage_file="coverage-${{ matrix.python-version }}-${{ matrix.os }}.xml" # Pase the coverage file and get the line rate for each package(two level) coverage_summary=$(grep -oP '