diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7aca1ece31..f616fff25f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,10 @@ on: merge_group: branches: [ main ] +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} + permissions: id-token: write contents: read @@ -23,16 +27,20 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/base-cache + - name: Install uv + uses: astral-sh/setup-uv@v5 with: + enable-cache: true python-version: ${{ matrix.python-version }} + cache-suffix: lint + - name: Validate lockfile + run: uv lock --check check-licenses: strategy: matrix: python-version: [ "3.12" ] runs-on: ubuntu-latest - needs: [setup] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/base-cache @@ -46,12 +54,16 @@ jobs: matrix: python-version: ["3.11", "3.12", "3.13"] runs-on: ubuntu-latest - needs: [setup, changelog] steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/base-cache + - name: Install uv + uses: astral-sh/setup-uv@v5 with: + enable-cache: true python-version: ${{ matrix.python-version }} + cache-suffix: lint + - name: Install lint dependencies + run: uv sync --locked --only-group lint - name: Lint run: make check @@ -77,7 +89,6 @@ jobs: matrix: python-version: ["3.11", "3.12", "3.13"] runs-on: opensource-linux-8core - needs: [setup, lint] steps: - uses: actions/checkout@v4 - uses: ./.github/actions/base-cache @@ -103,7 +114,6 @@ jobs: matrix: python-version: ["3.11", "3.12", "3.13"] runs-on: ubuntu-latest - needs: [setup, lint] steps: - uses: actions/checkout@v4 - name: Install uv @@ -144,7 +154,6 @@ jobs: - extra: xlsx uv-extras: "--extra xlsx" runs-on: opensource-linux-8core - needs: [setup, lint, test_unit_no_extras] steps: - uses: actions/checkout@v4 - name: Install uv @@ -158,7 +167,17 @@ jobs: - name: Install extra dependencies run: | uv sync --locked ${{ matrix.uv-extras }} --group test + - name: Install document system dependencies + if: matrix.extra != 'pdf-image' + run: | + packages=(libmagic-dev) + case "${{ matrix.extra }}" in + # The doc/ppt tests exercise legacy formats through LibreOffice. + docx|pptx) packages+=(libreoffice) ;; + esac + bash scripts/ci/install-system-deps.sh --packages-only "${packages[@]}" - name: Install system dependencies + if: matrix.extra == 'pdf-image' run: | bash scripts/ci/install-system-deps.sh - name: Test @@ -173,7 +192,6 @@ jobs: matrix: python-version: ["3.12"] runs-on: opensource-linux-8core - needs: [setup, lint] steps: # actions/checkout MUST come before auth - uses: 'actions/checkout@v4' @@ -240,7 +258,6 @@ jobs: matrix: python-version: ["3.12"] runs-on: ubuntu-latest - needs: [setup, lint] steps: - uses: 'actions/checkout@v4' - uses: ./.github/actions/base-cache @@ -258,7 +275,6 @@ jobs: matrix: python-version: ["3.12"] runs-on: ubuntu-latest - needs: [setup, lint] steps: - uses: 'actions/checkout@v4' - uses: ./.github/actions/base-cache @@ -291,7 +307,6 @@ jobs: # (Using the virtualenv to get pytest) test_dockerfile: runs-on: opensource-linux-8core - needs: [ setup, lint ] steps: - uses: actions/checkout@v4 - name: Test Dockerfile diff --git a/CHANGELOG.md b/CHANGELOG.md index 408f913c2f..873d7e4c50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 0.27.19-dev0 + +### Maintenance + +- **Start CI tests without waiting for setup and lint.** Lint installs only its own dependency group, extras jobs install only the system packages their tests use, and a new push cancels the pull request's previous CI run. + ## 0.27.18 ### Fixes diff --git a/scripts/ci/install-system-deps.sh b/scripts/ci/install-system-deps.sh index db51cc7279..e64c5bc2c0 100644 --- a/scripts/ci/install-system-deps.sh +++ b/scripts/ci/install-system-deps.sh @@ -31,6 +31,11 @@ install_packages() { } retry_download apt-get "${apt_options[@]}" -o APT::Update::Error-Mode=any update +if [[ "${1:-}" == "--packages-only" ]]; then + shift + install_packages "$@" + exit 0 +fi install_packages libmagic-dev poppler-utils libreoffice # Avoid add-apt-repository's implicit, unbounded index download. retry_download add-apt-repository --no-update -y ppa:alex-p/tesseract-ocr5 diff --git a/unstructured/__version__.py b/unstructured/__version__.py index 1c8487b647..26a99944d7 100644 --- a/unstructured/__version__.py +++ b/unstructured/__version__.py @@ -1 +1 @@ -__version__ = "0.27.18" # pragma: no cover +__version__ = "0.27.19-dev0" # pragma: no cover