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