pytest_cpu_gha_runner.yaml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. name: "[GHA][CPU] llama-recipes Pytest tests on CPU GitHub hosted runner."
  2. on:
  3. pull_request:
  4. branches:
  5. - 'main'
  6. # triggers workflow manually for debugging purposes.
  7. workflow_dispatch:
  8. inputs:
  9. runner:
  10. description: 'GHA Runner Scale Set label to run workflow on.'
  11. required: true
  12. default: ubuntu-20.04
  13. debug:
  14. description: 'Run debugging steps?'
  15. required: false
  16. default: "true"
  17. env:
  18. PYTORCH_WHEEL_URL: https://download.pytorch.org/whl/test/cu118
  19. jobs:
  20. execute_workflow:
  21. name: Execute workload on GHA CPU Runner
  22. defaults:
  23. run:
  24. shell: bash # default shell to run all steps for a given job.
  25. runs-on: ${{ github.event.inputs.runner != '' && github.event.inputs.runner || 'ubuntu-20.04' }}
  26. steps:
  27. - name: "[DEBUG] Get runner container OS information"
  28. id: os_info
  29. if: ${{ github.event.inputs.debug == 'true' }}
  30. run: |
  31. cat /etc/os-release
  32. - name: "Checkout 'facebookresearch/llama-recipes' repository"
  33. id: checkout
  34. uses: actions/checkout@v4
  35. - name: "[DEBUG] Content of the repository after checkout"
  36. id: content_after_checkout
  37. if: ${{ github.event.inputs.debug == 'true' }}
  38. run: |
  39. ls -la ${GITHUB_WORKSPACE}
  40. - name: "Installing Python dependencies"
  41. id: python_dependencies
  42. run: |
  43. pip3 install --upgrade pip
  44. pip3 install setuptools
  45. - name: "Installing 'llama-recipes' project"
  46. id: install_llama_recipes_package
  47. run: |
  48. echo "Installing 'llama-recipes' project (re: https://github.com/facebookresearch/llama-recipes?tab=readme-ov-file#install-with-optional-dependencies)"
  49. pip install --extra-index-url ${PYTORCH_WHEEL_URL} -e '.[tests]'
  50. - name: "Running PyTest tests on GHA CPU Runner"
  51. id: pytest
  52. run: |
  53. echo "Running PyTest tests at 'GITHUB_WORKSPACE' path: ${GITHUB_WORKSPACE}"
  54. cd $GITHUB_WORKSPACE && python3 -m pytest --junitxml="$GITHUB_WORKSPACE/result.xml"
  55. - name: Publish Test Summary
  56. id: test_summary
  57. uses: test-summary/action@v2
  58. with:
  59. paths: "**/*.xml"
  60. if: always()