integration.yaml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. name: Lint and mock tests
  2. # Runs on every push and pull request — including PRs from forks. This workflow
  3. # is intentionally limited to lint + the mock provider so it can run safely on
  4. # untrusted code (no secrets, no cloud credentials).
  5. #
  6. # Cloud-provider integration tests live in integration-cloud.yaml, which uses
  7. # pull_request_target plus a maintainer-applied `safe-to-test` label and a
  8. # protected GitHub Environment.
  9. on:
  10. push:
  11. branches:
  12. - main
  13. pull_request:
  14. branches:
  15. - main
  16. workflow_dispatch: {}
  17. permissions:
  18. contents: read
  19. jobs:
  20. lint:
  21. name: Lint code
  22. runs-on: ubuntu-latest
  23. strategy:
  24. matrix:
  25. python-version: [ '3.13' ]
  26. steps:
  27. - name: Checkout code
  28. uses: actions/checkout@v6
  29. with:
  30. persist-credentials: false
  31. - name: Setup Python
  32. uses: actions/setup-python@v6
  33. with:
  34. python-version: ${{ matrix.python-version }}
  35. - name: Cache pip dir
  36. uses: actions/cache@v5
  37. with:
  38. path: ~/.cache/pip
  39. key: pip-cache-${{ matrix.python-version }}-lint
  40. - name: Install required packages
  41. run: pip install tox
  42. - name: Run tox
  43. run: tox -e lint
  44. mock:
  45. name: Mock-provider tests
  46. runs-on: ubuntu-latest
  47. strategy:
  48. matrix:
  49. python-version: ['3.13']
  50. steps:
  51. - name: Checkout code
  52. uses: actions/checkout@v6
  53. with:
  54. persist-credentials: false
  55. - name: Setup Python
  56. uses: actions/setup-python@v6
  57. with:
  58. python-version: ${{ matrix.python-version }}
  59. - name: Cache pip dir
  60. uses: actions/cache@v5
  61. with:
  62. path: ~/.cache/pip
  63. key: pip-cache-${{ matrix.python-version }}-${{ hashFiles('**/setup.py', '**/requirements.txt') }}
  64. - name: Install required packages
  65. run: pip install tox
  66. - name: Run tox
  67. run: tox -e py${{ matrix.python-version }}-mock
  68. env:
  69. PYTHONUNBUFFERED: "True"