CI: Run tests against oldest and latest supported versions of lakefs … #980
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: Python | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: write | |
jobs: | |
lint: | |
name: Run code checks and formatting hooks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install Python 3.10 interpreter | |
run: uv python install 3.10 | |
- name: Install the project | |
run: uv sync --extra dev | |
- name: Run pre-commit checks | |
run: uvx pre-commit run --all-files --verbose --show-diff-on-failure | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.10", "3.11", "3.12"] | |
deps: | |
# Oldest supported versions | |
- lakefs: "lakefs==0.2.0" | |
fsspec: "fsspec==2023.12.0" | |
# Latest versions | |
- lakefs: "lakefs>0" | |
fsspec: "fsspec>0" | |
name: "Tests: Python ${{ matrix.python-version }}, ${{ matrix.deps.lakefs }}, ${{ matrix.deps.fsspec }} (on ${{ matrix.os }})" | |
runs-on: ${{ matrix.os }} | |
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 | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install Python ${{ matrix.python-version }} | |
run: uv python install ${{ matrix.python-version }} | |
- name: "Install deps: ${{ matrix.deps.lakefs }}, ${{ matrix.deps.fsspec }}" | |
run: | | |
uv lock -P ${{ matrix.deps.lakefs }} | |
uv lock -P ${{ matrix.deps.fsspec }} | |
- name: Install the project | |
run: uv sync --extra dev | |
- name: Execute python tests | |
run: uv run 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 }} | |
with: | |
flags: ${{ matrix.python-version }} | |
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: Install uv | |
uses: astral-sh/setup-uv@v3 | |
- name: Install Python 3.11 interpreter | |
run: uv python install 3.11 | |
- name: Install the project | |
run: uv sync --extra docs | |
- 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 |