Skip to content

Update pre-commit hooks, change lockfile to use uv pip compile (#278) #945

Update pre-commit hooks, change lockfile to use uv pip compile (#278)

Update pre-commit hooks, change lockfile to use uv pip compile (#278) #945

Workflow file for this run

name: lakefs-spec CI
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: write
jobs:
lint:
name: Run code checks and formatting hooks
runs-on: ubuntu-latest
env:
MYPY_CACHE_DIR: "${{ github.workspace }}/.cache/mypy"
RUFF_CACHE_DIR: "${{ github.workspace }}/.cache/ruff"
PRE_COMMIT_HOME: "${{ github.workspace }}/.cache/pre-commit"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # for documentation builds
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: pip
cache-dependency-path: |
requirements-dev.txt
pyproject.toml
- name: Install dependencies
run: |
pip install -r requirements-dev.txt
pip install . --no-deps
- name: Cache pre-commit tools
uses: actions/cache@v4
with:
path: |
${{ env.MYPY_CACHE_DIR }}
${{ env.RUFF_CACHE_DIR }}
${{ env.PRE_COMMIT_HOME }}
key: ${{ runner.os }}-${{ hashFiles('requirements-dev.txt', '.pre-commit-config.yaml') }}-linter-cache
- name: Run pre-commit checks
run: pre-commit run --all-files --verbose --show-diff-on-failure
test:
name: Test lakefs-spec on ubuntu-latest
runs-on: ubuntu-latest
services:
lakefs:
image: treeverse/lakefs:latest
ports:
- 8000:8000
env:
LAKEFS_INSTALLATION_USER_NAME: "quickstart"
LAKEFS_INSTALLATION_ACCESS_KEY_ID: "AKIAIOSFOLQUICKSTART"
LAKEFS_INSTALLATION_SECRET_ACCESS_KEY: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
LAKEFS_DATABASE_TYPE: "local"
LAKEFS_AUTH_ENCRYPT_SECRET_KEY: "THIS_MUST_BE_CHANGED_IN_PRODUCTION"
LAKEFS_BLOCKSTORE_TYPE: "local"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up oldest supported Python (3.9) for testing
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Test on oldest supported Python
run: |
python -m pip install -r requirements-dev.txt
python -m pip install -e .
pytest -s --cov=src --cov=fsspec --cov-branch --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
docs:
name: Build documentation for lakefs-spec
runs-on: ubuntu-latest
services:
lakefs:
image: treeverse/lakefs:latest
ports:
- 8000:8000
env:
LAKEFS_INSTALLATION_USER_NAME: "quickstart"
LAKEFS_INSTALLATION_ACCESS_KEY_ID: "AKIAIOSFOLQUICKSTART"
LAKEFS_INSTALLATION_SECRET_ACCESS_KEY: "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
LAKEFS_DATABASE_TYPE: "local"
LAKEFS_AUTH_ENCRYPT_SECRET_KEY: "THIS_MUST_BE_CHANGED_IN_PRODUCTION"
LAKEFS_BLOCKSTORE_TYPE: "local"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.11 for docs build
uses: actions/setup-python@v5
with:
python-version: 3.11
cache: pip
cache-dependency-path: |
requirements-docs.txt
pyproject.toml
- name: Install dependencies
run: |
pip install -r requirements-docs.txt
pip install . --no-deps
- name: Build documentation using mike
uses: ./.github/actions/mike-docs
with:
version: development
pre_release: true # include pre-release notification banner
push: ${{ github.ref == 'refs/heads/main' }} # build always, publish on 'main' only to prevent version clutter