copilot-setup-steps.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. name: "Copilot Setup Steps"
  2. # Automatically run the setup steps when they are changed to allow for easy validation, and
  3. # allow manual testing through the repository's "Actions" tab
  4. on:
  5. workflow_dispatch:
  6. push:
  7. paths:
  8. - .github/workflows/copilot-setup-steps.yml
  9. pull_request:
  10. paths:
  11. - .github/workflows/copilot-setup-steps.yml
  12. jobs:
  13. # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
  14. copilot-setup-steps:
  15. runs-on: ubuntu-latest
  16. # Set the permissions to the lowest permissions possible needed for your steps.
  17. # Copilot will be given its own token for its operations.
  18. permissions:
  19. # If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
  20. contents: read
  21. # You can define any steps you want, and they will run before the agent starts.
  22. # If you do not check out your code, Copilot will do this for you.
  23. steps:
  24. - name: Checkout code
  25. uses: actions/checkout@v4
  26. - name: ccache
  27. uses: ggml-org/ccache-action@v1.2.16
  28. with:
  29. key: copilot-setup-steps
  30. evict-old-files: 1d
  31. - name: Dependencies
  32. id: depends
  33. run: |
  34. sudo apt-get update
  35. sudo apt-get install build-essential libcurl4-openssl-dev
  36. # Install git-clang-format script for formatting only changed code
  37. wget -O /tmp/git-clang-format https://raw.githubusercontent.com/llvm/llvm-project/release/18.x/clang/tools/clang-format/git-clang-format
  38. sudo cp /tmp/git-clang-format /usr/local/bin/git-clang-format
  39. sudo chmod +x /usr/local/bin/git-clang-format
  40. - name: Set up Python
  41. uses: actions/setup-python@v5
  42. with:
  43. python-version: '3.11'
  44. - name: Install Python dependencies
  45. run: |
  46. python3 -m venv .venv
  47. .venv/bin/activate
  48. pip install -r requirements/requirements-all.txt -r tools/server/tests/requirements.txt
  49. pip install flake8 pyright pre-commit