Enhance Qurator context with automatic README.md loading #11900
This file contains hidden or 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
on: | |
push: | |
branches: | |
- master | |
tags: | |
- "*" | |
pull_request: | |
merge_group: | |
env: | |
UV_LOCKED: 1 | |
jobs: | |
lint-quilt3: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: api/python | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: astral-sh/setup-uv@v6 | |
- name: Lint | |
run: uv run poe lint | |
format-quilt3: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: api/python | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: astral-sh/setup-uv@v6 | |
- name: Check formatting (quilt3) | |
run: uv run poe fmt --check | |
lint-rest: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: astral-sh/setup-uv@v6 | |
- name: Run Ruff linter on entire codebase | |
run: uvx [email protected] check . --exclude catalog/ --exclude api/python/ | |
# Enable once the rest of the codebase is formatted | |
# format-rest: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v5 | |
# - uses: astral-sh/setup-uv@v6 | |
# - name: Check formatting (rest of codebase) | |
# run: uvx [email protected] format --check --exclude catalog/ --exclude api/python/ | |
test-gendocs: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: api/python | |
env: | |
QUILT_DISABLE_USAGE_METRICS: true | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: astral-sh/setup-uv@v6 | |
- name: Check generated docs are up-to-date | |
run: uv run poe gendocs-check | |
test-testdocs: | |
runs-on: ubuntu-latest | |
env: | |
QUILT_DISABLE_USAGE_METRICS: true | |
defaults: | |
run: | |
working-directory: api/python | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: astral-sh/setup-uv@v6 | |
- name: Test codeblocks | |
run: uv run poe testdocs | |
test-client: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
runs-on: ${{ matrix.os }} | |
env: | |
QUILT_DISABLE_USAGE_METRICS: true | |
defaults: | |
run: | |
working-directory: api/python | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: astral-sh/setup-uv@v6 | |
- name: Run Pytest | |
run: uv run --python ${{ matrix.python-version }} poe test-cov --cov-report xml | |
- uses: codecov/codecov-action@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
OS: ${{ matrix.os }} | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
with: | |
flags: api-python | |
name: ${{ github.job }} | |
env_vars: OS,PYTHON_VERSION | |
pypi-release-tag-check: | |
needs: test-client | |
runs-on: ubuntu-latest | |
outputs: | |
check: ${{ steps.check.outputs.check }} | |
if: github.ref_type == 'tag' | |
steps: | |
- name: check git tag | |
id: check | |
run: | | |
if [[ ${{ github.ref_name }} =~ ^[0-9]+(\.[0-9]+)*([abrc]+[0-9]+)?$ ]]; then | |
echo ::set-output name=check::true | |
fi | |
pypi-release: | |
needs: pypi-release-tag-check | |
if: github.ref_type == 'tag' && needs.pypi-release-tag-check.outputs.check == 'true' | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: api/python | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: astral-sh/setup-uv@v6 | |
- name: verify git tag vs. version | |
run: uv run poe verify-release-tag "${{ github.ref_name }}" | |
- name: build | |
run: uv build | |
- name: upload to PyPI | |
env: | |
UV_PUBLISH_USERNAME: ${{ secrets.PYPI_USERNAME }} | |
UV_PUBLISH_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | |
run: uv publish | |
test-lambda: | |
strategy: | |
fail-fast: false | |
matrix: | |
path: | |
- access_counts | |
- es_ingest | |
- indexer | |
- manifest_indexer | |
- pkgevents | |
- pkgpush | |
- preview | |
- s3hash | |
- shared | |
- status_reports | |
- tabular_preview | |
- thumbnail | |
- transcode | |
runs-on: ubuntu-latest | |
env: | |
QUILT_DISABLE_USAGE_METRICS: true | |
PYTHONPATH: deps | |
JUPYTER_PATH: deps/share/jupyter # Jupyter is not smart enough to handle custom Python paths | |
steps: | |
- uses: actions/checkout@v5 | |
- uses: actions/setup-python@v6 | |
with: | |
python-version-file: lambdas/${{ matrix.path }}/.python-version | |
- uses: astral-sh/setup-uv@v6 | |
- name: Export requirements.txt from uv.lock | |
if: ${{ hashFiles(format('lambdas/{0}/uv.lock', matrix.path)) != '' }} | |
run: | | |
uv export --locked --no-emit-project --no-hashes --directory lambdas/${{ matrix.path }} -o requirements.txt | |
uv export --locked --no-emit-project --no-hashes --directory lambdas/${{ matrix.path }} --only-group test -o test-requirements.txt | |
- name: Install dependencies | |
run: | | |
if [ ${{ matrix.path }} == "thumbnail" ] | |
then | |
# Due to behavior change in pip>=23.1 installing tifffile==0.15.1 | |
# from thumbnail lambda fails whithout installed wheel. | |
# See https://github.com/pypa/pip/issues/8559. | |
# HACK: Pre-install numpy v1 as a build dependency for tifffile to prevent it from using v2 and failing to build | |
python -m pip install wheel 'numpy<2' | |
fi | |
# Try to simulate the lambda .zip file: | |
# - Use --no-deps to ensure that second-order dependencies are included in the requirements file | |
# - Remove "tests" directories | |
# - Run "strip" on shared libraries | |
python -m pip install -t deps --no-deps -r lambdas/${{ matrix.path }}/requirements.txt lambdas/${{ matrix.path }} | |
find deps -name tests -type d -exec rm -r \{} \+ | |
find deps \( -name '*.so.*' -o -name '*.so' \) -type f -exec strip \{} \+ | |
python -m pip install -r lambdas/${{ matrix.path }}/test-requirements.txt | |
- name: Pytest | |
run: | | |
python -m pytest --cov=lambdas lambdas/${{ matrix.path }} | |
- uses: codecov/codecov-action@v5 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
LAMBDA: ${{ matrix.path }} | |
with: | |
flags: lambda | |
name: ${{ github.job }} | |
env_vars: LAMBDA |