CI #2770
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
| # This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
| # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
| name: CI | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '0 0 * * *' # every day at midnight | |
| jobs: | |
| build: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| # Default builds are on Ubuntu | |
| os: [ubuntu-latest] | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.10'] | |
| include: | |
| # Also test on macOS and Windows using the latest Python 3 | |
| - os: macos-latest | |
| python-version: 3.x | |
| - os: windows-latest | |
| python-version: 3.x | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install pytest | |
| python -m pip install interrogate | |
| - name: Setup Graphviz | |
| uses: ts-graphviz/setup-graphviz@v2 | |
| - name: Show Node.js version | |
| run: | | |
| node --version | |
| - name: Test with pytest (excluding external API tests) | |
| run: | | |
| pip install . | |
| pytest --ignore=test/test_docstr_coverage.py --ignore=test/test_calculate_complexity_scores.py -s | |
| # Separate job for external API tests that only runs on one platform to avoid rate limiting | |
| # This prevents multiple simultaneous API calls to external services (like IDT complexity scoring) | |
| # that could result in rate limiting or service failures (fixes issue #368) | |
| external-api-tests: | |
| runs-on: ubuntu-latest | |
| env: | |
| IDT_CREDENTIALS: ${{ secrets.IDT_CREDENTIALS }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install pytest | |
| - name: Setup Graphviz | |
| uses: ts-graphviz/setup-graphviz@v2 | |
| - name: Show Node.js version | |
| run: | | |
| node --version | |
| - name: Test external API functionality (complexity scoring) | |
| run: | | |
| pip install . | |
| echo "$IDT_CREDENTIALS" > test_secret_idt_credentials.json | |
| pytest test/test_calculate_complexity_scores.py -s |