-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (49 loc) · 1.38 KB
/
code-embedder.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: 🪄 Code Embedder
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
jobs:
code_embedder:
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.12"
UV_SYSTEM_PYTHON: 1
steps:
- name: 🛎️ Checkout
uses: actions/checkout@v4
# with:
# ref: ${{ github.event.pull_request.head.ref }}
- name: 🐍 Install uv with caching
uses: astral-sh/setup-uv@v3
with:
enable-cache: true
version: "0.5.4"
- name: 🐍 Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: 💾 Setup pip cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('uv.lock') }}
- name: 📥 Install the project
run: |
uv sync --all-extras --dev
uv pip install .
- name: 🪄 Format raw code snippets with ruff
run: |
pipx install ruff
ruff format dev/readme_snippets/
- name: 🪄 Format print comments in code snippets
run: python dev/scripts/format_snippet_prints.py
- name: 📝 Run code embedder
uses: kvankova/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}