Skip to content

Commit 63c0121

Browse files
committed
Merge branch 'main' into andrin/fallbacks
2 parents 66c4c00 + 10f902a commit 63c0121

35 files changed

Lines changed: 5658 additions & 1955 deletions

.github/workflows/benchmarks.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: Benchmarks
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "tesseract_core/**"
7+
- "benchmarks/**"
8+
- ".github/workflows/benchmarks.yml"
9+
- "benchmarks/compare_benchmarks.py"
10+
11+
push:
12+
branches:
13+
- main
14+
paths:
15+
- "tesseract_core/**"
16+
- "benchmarks/**"
17+
- ".github/workflows/benchmarks.yml"
18+
- "benchmarks/compare_benchmarks.py"
19+
20+
concurrency:
21+
group: benchmarks-${{ github.event.pull_request.number || github.ref }}
22+
cancel-in-progress: true
23+
24+
permissions:
25+
contents: read
26+
pull-requests: write
27+
28+
jobs:
29+
benchmark:
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Set up Git repository
34+
uses: actions/checkout@v6
35+
36+
- name: Set up Python
37+
uses: actions/setup-python@v6
38+
with:
39+
python-version: "3.13"
40+
41+
- name: Set up uv
42+
uses: astral-sh/setup-uv@v7
43+
with:
44+
enable-cache: true
45+
46+
- name: Restore UV environment
47+
run: cp production.uv.lock uv.lock
48+
49+
- name: Install package
50+
run: uv sync --extra dev --frozen
51+
52+
- name: Run benchmarks on current commit
53+
run: |
54+
uv run --no-sync python benchmarks/run_benchmarks.py \
55+
--iterations 10 \
56+
--array-sizes 100,10000,1000000 \
57+
--output current_benchmarks.json
58+
59+
- name: Check out baseline branch
60+
if: github.event_name == 'pull_request'
61+
uses: actions/checkout@v6
62+
with:
63+
ref: ${{ github.event.pull_request.base.ref }}
64+
path: baseline
65+
66+
- name: Install package (baseline)
67+
if: github.event_name == 'pull_request'
68+
working-directory: baseline
69+
run: |
70+
cp production.uv.lock uv.lock 2>/dev/null || true
71+
uv sync --extra dev --frozen
72+
73+
- name: Run benchmarks on baseline
74+
if: github.event_name == 'pull_request'
75+
id: baseline
76+
working-directory: baseline
77+
run: |
78+
if [ -f benchmarks/run_benchmarks.py ]; then
79+
uv run --no-sync python benchmarks/run_benchmarks.py \
80+
--iterations 10 \
81+
--array-sizes 100,10000,1000000 \
82+
--output baseline_benchmarks.json
83+
echo "exists=true" >> $GITHUB_OUTPUT
84+
else
85+
echo "::notice::Benchmark script not found in baseline, skipping comparison"
86+
echo "exists=false" >> $GITHUB_OUTPUT
87+
fi
88+
89+
- name: Generate comparison report
90+
if: github.event_name == 'pull_request'
91+
id: comparison
92+
run: |
93+
python benchmarks/compare_benchmarks.py \
94+
baseline/baseline_benchmarks.json \
95+
current_benchmarks.json \
96+
benchmark_report.md
97+
98+
# Set output as multiline string
99+
{
100+
echo 'report<<BENCHMARK_REPORT_END'
101+
cat benchmark_report.md
102+
echo ''
103+
echo 'BENCHMARK_REPORT_END'
104+
} >> $GITHUB_OUTPUT
105+
106+
- name: Find existing comment
107+
if: github.event_name == 'pull_request'
108+
uses: peter-evans/find-comment@v3
109+
id: find-comment
110+
with:
111+
issue-number: ${{ github.event.pull_request.number }}
112+
comment-author: "PasteurBot"
113+
body-includes: "## Benchmark Results"
114+
115+
- name: Create or update PR comment
116+
if: github.event_name == 'pull_request'
117+
uses: peter-evans/create-or-update-comment@v4
118+
with:
119+
token: ${{ secrets.PL_PASTEURBOT_PAT_PUBLIC }}
120+
comment-id: ${{ steps.find-comment.outputs.comment-id }}
121+
issue-number: ${{ github.event.pull_request.number }}
122+
body: ${{ steps.comparison.outputs.report }}
123+
edit-mode: replace
124+
125+
- name: Upload benchmark results
126+
uses: actions/upload-artifact@v7
127+
with:
128+
name: benchmark-results
129+
path: |
130+
current_benchmarks.json
131+
baseline/baseline_benchmarks.json
132+
benchmark_report.md
133+
if-no-files-found: ignore
134+
retention-days: 30

.github/workflows/get_bump_type.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -e
44

55
bump_type="auto"
6+
current_version=$(gh release view --json tagName --jq '.tagName' || echo "v0.0.0")
67

78
# Prevent bumping major versions, downgrade to minor in this case
89
new_version=$(git-cliff --bumped-version --bump $bump_type)

.github/workflows/run_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ jobs:
130130

131131
- name: Get all changed files
132132
id: changed-files
133-
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47
133+
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47
134134
with:
135135
files: |
136136
tesseract_core/**

.github/workflows/test_pip_install.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ jobs:
1616
python-version:
1717
- "3.10"
1818
- "3.13"
19+
dependencies:
20+
- "pinned"
21+
22+
include:
23+
- os: ubuntu-latest
24+
python-version: "3.13"
25+
dependencies: "latest"
1926

2027
fail-fast: false
2128

@@ -30,9 +37,22 @@ jobs:
3037

3138
- name: Install package
3239
run: |
33-
pip install -r requirements.txt
34-
pip install --no-deps .
40+
if [ "${{ matrix.dependencies }}" = "pinned" ]; then
41+
echo "Using pinned dependencies"
42+
pip install -r requirements.txt
43+
pip install --no-deps .
44+
else
45+
echo "Using latest dependencies"
46+
pip install .
47+
fi
3548
36-
- name: Ensure CLI is usable (no missing deps)
49+
- name: Ensure CLI is available
3750
run: |
3851
tesseract --help
52+
53+
- name: Ensure basic workflow works
54+
# Docker is only available on Linux
55+
if: ${{ matrix.os == 'ubuntu-latest' }}
56+
run: |
57+
tesseract build examples/helloworld
58+
tesseract run helloworld apply '{"inputs": {"name": "GitHub Actions"}}'

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ repos:
2929

3030
- repo: https://github.com/astral-sh/ruff-pre-commit
3131
# Ruff version.
32-
rev: v0.15.4
32+
rev: v0.15.5
3333
hooks:
3434
# Run the linter.
3535
- id: ruff

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [1.5.1] - 2026-03-09
6+
7+
### Bug Fixes
8+
9+
- Add missing dep, test default install (no extras) + basic usage on CI (#514)
10+
511
## [1.5.0] - 2026-03-05
612

713
### Features

benchmarks/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
plots/
2+
results.json

0 commit comments

Comments
 (0)