feat: update ci pipeline so that it leverages on uv #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Lint, Test | |
on: | |
push: | |
pull_request: | |
branches: [main] | |
concurrency: | |
# New commit on branch cancels running workflows of the same branch | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
PYTHON_VERSION: "3.12.4" | |
UV_CACHE_DIR: /tmp/.uv-cache | |
jobs: | |
lint-and-test: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
- name: Set up uv | |
run: curl -LsSf https://astral.sh/uv/install.sh | sh | |
- name: Setup python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Restore uv cache | |
uses: actions/cache@v4 | |
with: | |
path: /tmp/.uv-cache | |
key: uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
restore-keys: | | |
uv-${{ runner.os }}-${{ hashFiles('uv.lock') }} | |
uv-${{ runner.os }} | |
- name: Install project | |
run: uv sync --all-extras --dev | |
- name: Setup just | |
uses: taiki-e/install-action@just | |
- name: Enforce code style (Ruff) | |
run: just ruff-show-violations | |
- name: Verify code formatting (Ruff) | |
run: just ruff-format-check | |
- name: Run tests | |
run: just test | |
- name: Minimize uv cache | |
run: uv cache prune --ci |