| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- name: Lint and mock tests
- # Runs on every push and pull request — including PRs from forks. This workflow
- # is intentionally limited to lint + the mock provider so it can run safely on
- # untrusted code (no secrets, no cloud credentials).
- #
- # Cloud-provider integration tests live in integration-cloud.yaml, which uses
- # pull_request_target plus a maintainer-applied `safe-to-test` label and a
- # protected GitHub Environment.
- on:
- push:
- branches:
- - main
- paths-ignore:
- - 'docs/**'
- - '**.md'
- - '**.rst'
- - LICENSE
- pull_request:
- branches:
- - main
- paths-ignore:
- - 'docs/**'
- - '**.md'
- - '**.rst'
- - LICENSE
- workflow_dispatch: {}
- permissions:
- contents: read
- jobs:
- lint:
- name: Lint code
- runs-on: ubuntu-latest
- strategy:
- matrix:
- python-version: [ '3.13' ]
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
- with:
- persist-credentials: false
- - name: Setup Python
- uses: actions/setup-python@v6
- with:
- python-version: ${{ matrix.python-version }}
- - name: Cache pip dir
- uses: actions/cache@v5
- with:
- path: ~/.cache/pip
- key: pip-cache-${{ matrix.python-version }}-lint
- - name: Install required packages
- run: pip install tox
- - name: Run tox
- run: tox -e lint
- - name: Run mypy
- run: tox -e mypy
- mock:
- name: Mock-provider tests
- runs-on: ubuntu-latest
- strategy:
- matrix:
- # Lowest and highest supported Python versions
- python-version: ['3.10', '3.13']
- steps:
- - name: Checkout code
- uses: actions/checkout@v6
- with:
- persist-credentials: false
- - name: Setup Python
- uses: actions/setup-python@v6
- with:
- python-version: ${{ matrix.python-version }}
- - name: Cache pip dir
- uses: actions/cache@v5
- with:
- path: ~/.cache/pip
- key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml', '**/requirements.txt') }}
- - name: Install required packages
- run: pip install tox
- - name: Run tox
- run: tox -e py${{ matrix.python-version }}-mock
- env:
- PYTHONUNBUFFERED: "True"
|