Skip to content

chore: updated and linted #281

chore: updated and linted

chore: updated and linted #281

Workflow file for this run

name: CI Docker Build & Test
on:
push:
branches: [main]
paths:
- '.github/actions/**'
- 'crates/kreuzberg/**'
- 'crates/kreuzberg-cli/**'
- 'crates/kreuzberg-tesseract/**'
- 'docker/**'
- '.dockerignore'
- 'Cargo.toml'
- 'Cargo.lock'
- '.cargo/config.toml'
- 'scripts/ci/docker/**'
- '.github/workflows/ci-docker.yaml'
pull_request:
branches: [main]
paths:
- '.github/actions/**'
- 'crates/kreuzberg/**'
- 'crates/kreuzberg-cli/**'
- 'crates/kreuzberg-tesseract/**'
- 'docker/**'
- '.dockerignore'
- 'Cargo.toml'
- 'Cargo.lock'
- '.cargo/config.toml'
- 'scripts/ci/docker/**'
- '.github/workflows/ci-docker.yaml'
workflow_dispatch:
inputs:
skip_tests:
description: 'Skip feature tests (build only)'
required: false
type: boolean
default: false
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
ORT_VERSION: "1.23.2"
jobs:
test-docker:
name: Build and Test Docker Image (${{ matrix.variant }})
if: ${{ github.actor != 'dependabot[bot]' }}
runs-on: ubuntu-latest
timeout-minutes: 180
permissions:
contents: read
strategy:
fail-fast: true
matrix:
variant:
- core
- full
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Free up disk space
shell: bash
run: scripts/ci/docker/free-disk-space.sh
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.${{ matrix.variant }}
push: false
load: true
tags: kreuzberg:${{ matrix.variant }}
build-args: |
ONNXRUNTIME_VERSION=${{ env.ORT_VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max,scope=ci-docker-${{ matrix.variant }}
- name: Test Docker image size
shell: bash
run: scripts/ci/docker/check-image-size.sh "${{ matrix.variant }}"
- name: Run comprehensive feature tests
if: ${{ !inputs.skip_tests }}
run: scripts/ci/docker/run-feature-tests.sh "${{ matrix.variant }}"
- name: Save Docker image as artifact
if: success()
shell: bash
run: scripts/ci/docker/save-image.sh "${{ matrix.variant }}" /tmp
- name: Upload Docker image artifact
if: success()
uses: actions/upload-artifact@v6
with:
name: docker-image-${{ matrix.variant }}
path: /tmp/kreuzberg-${{ matrix.variant }}.tar.gz
retention-days: 7
compression-level: 0
- name: Upload test results
if: always() && !inputs.skip_tests
uses: actions/upload-artifact@v6
with:
name: docker-test-results-${{ matrix.variant }}
path: /tmp/kreuzberg-docker-test-results.json
retention-days: 7
- name: Collect Docker logs on failure
if: failure()
shell: bash
run: scripts/ci/docker/collect-logs.sh /tmp/docker-logs
- name: Upload Docker logs
if: failure()
uses: actions/upload-artifact@v6
with:
name: docker-logs-${{ matrix.variant }}
path: /tmp/docker-logs/
retention-days: 7
- name: Clean up Docker resources
if: always()
shell: bash
run: scripts/ci/docker/cleanup.sh "${{ matrix.variant }}"
- name: Summary
if: success()
shell: bash
run: scripts/ci/docker/summary.sh "${{ matrix.variant }}" /tmp/kreuzberg-docker-test-results.json