diff --git a/.github/actions/python-deps/action.yaml b/.github/actions/python-deps/action.yaml index b7ef9c04..da66fabb 100644 --- a/.github/actions/python-deps/action.yaml +++ b/.github/actions/python-deps/action.yaml @@ -8,7 +8,7 @@ runs: using: "composite" steps: - name: Set up Python - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ inputs.pythonVersion }} cache: 'pip' diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 452b6ed9..691054c6 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -12,7 +12,41 @@ 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: @@ -26,45 +60,45 @@ jobs: LAKEFS_DATABASE_TYPE: "local" LAKEFS_AUTH_ENCRYPT_SECRET_KEY: "THIS_MUST_BE_CHANGED_IN_PRODUCTION" LAKEFS_BLOCKSTORE_TYPE: "local" - 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@v3 - with: - fetch-depth: 0 # for documentation builds - - name: Set up Python and dependencies - uses: ./.github/actions/python-deps - with: - pythonVersion: 3.11 - - name: Cache pre-commit tools - uses: actions/cache@v3 - 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 - - name: Set up oldest supported Python for testing (3.9) - uses: actions/setup-python@v4 - with: - python-version: 3.9 - - name: Test on oldest supported Python - run: | - python -m pip install --upgrade pip - python -m pip install -e ".[dev]" - pytest -s --cov=src --cov=fsspec --cov-branch --cov-report=xml - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3 - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - - name: Documentation - 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 + - 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: | + pip install -r requirements-dev.txt + pip install . --no-deps + pytest -s --cov=src --cov=fsspec --cov-branch --cov-report=xml + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v3 + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + docs: + name: Build documentation for lakefs-spec + runs-on: ubuntu-latest + 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 (and optionally push) 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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 7b8868eb..c9d65205 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -24,7 +24,7 @@ jobs: LAKEFS_BLOCKSTORE_TYPE: "local" steps: - name: Check out repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 # for documentation builds - name: Set up Python and dependencies