Skip to content

Commit

Permalink
Split lakefs-spec test job into multiple jobs
Browse files Browse the repository at this point in the history
This way, it is easier to understand whether a CI failure is a lint,
test, or docs build failure. Previously, this was not possible as the
pipeline did not tolerate failure.
  • Loading branch information
nicholasjng committed Jan 27, 2024
1 parent 8a53184 commit 0f60b17
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 43 deletions.
2 changes: 1 addition & 1 deletion .github/actions/python-deps/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
116 changes: 75 additions & 41 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f60b17

Please sign in to comment.