Skip to content

πŸ’š Add ruff formatting to code snippets in github workflow #23

πŸ’š Add ruff formatting to code snippets in github workflow

πŸ’š Add ruff formatting to code snippets in github workflow #23

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"
steps:
- name: πŸ›ŽοΈ Checkout
uses: actions/checkout@v4
# with:
# ref: ${{ github.event.pull_request.head.ref }}
- 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: |
pip install .
- name: πŸͺ„ Format raw code snippets with ruff
run: 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 }}