regenerate_integration_tests.yml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. name: Regenerate Integration Tests
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. debug:
  6. description: 'Enable debug mode'
  7. type: boolean
  8. default: true
  9. log_to_file:
  10. description: 'Enable logging to file'
  11. type: boolean
  12. default: true
  13. force_regenerate_tests:
  14. description: 'Force regeneration of tests'
  15. type: boolean
  16. default: false
  17. force_use_llm:
  18. description: 'Force use of LLM'
  19. type: boolean
  20. default: false
  21. jobs:
  22. regenerate_integration_tests:
  23. if: github.ref != 'refs/heads/main'
  24. runs-on: ubuntu-latest
  25. steps:
  26. - name: Checkout repository
  27. uses: actions/checkout@v4
  28. - name: Set up Docker Buildx
  29. id: buildx
  30. uses: docker/setup-buildx-action@v3
  31. - name: Set up Python
  32. uses: actions/setup-python@v5
  33. with:
  34. python-version: "3.12"
  35. - name: Cache Poetry dependencies
  36. uses: actions/cache@v4
  37. with:
  38. path: |
  39. ~/.cache/pypoetry
  40. ~/.virtualenvs
  41. key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
  42. restore-keys: |
  43. ${{ runner.os }}-poetry-
  44. - name: Install poetry via pipx
  45. run: pipx install poetry
  46. - name: Install Python dependencies using Poetry
  47. run: make install-python-dependencies
  48. - name: Build Environment
  49. run: make build
  50. - name: Regenerate integration tests
  51. run: |
  52. DEBUG=${{ inputs.debug }} \
  53. LOG_TO_FILE=${{ inputs.log_to_file }} \
  54. FORCE_REGENERATE_TESTS=${{ inputs.force_regenerate_tests }} \
  55. FORCE_USE_LLM=${{ inputs.force_use_llm }} \
  56. ./tests/integration/regenerate.sh
  57. - name: Commit changes
  58. run: |
  59. if git diff --quiet --exit-code; then
  60. echo "No changes to commit"
  61. exit 0
  62. fi
  63. git config --global user.name 'github-actions[bot]'
  64. git config --global user.email 'github-actions[bot]@users.noreply.github.com'
  65. git add .
  66. # run it twice in case pre-commit makes changes
  67. git commit -am "Regenerate integration tests" || git commit -am "Regenerate integration tests"
  68. git push