Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
CI: the examples leave the fast tier, the native pull-request leg kee…
…ps the oldest and the newest Python (#442)

The first run of this pull request took 31.8 minutes, and both jobs that
ended it were example jobs: `Test Python Examples (linux/amd64, Python
3.14)` (29.8 minutes) and `Examples on the installed wheel (linux-x86_64,
Python 3.12)` (19.0). Their longest step is `Download datasets` (891 s and
608 s), which mostly builds the vectors of the Stack Overflow dataset. The
target for a pull request is about 15 minutes.

- A pull request runs no example leg in either workflow. The examples run
  on a push to main, in the nightly run, on a manual run and with the
  label ci:full, like the rest of the full tier.
- Exception, by path and at job level: a pull request that changes a file
  under examples/ (not examples/README.md), scripts/run_examples.sh or
  scripts/native_examples_skip.txt runs the example leg of Linux x86-64.
  scripts/ci_tier.py reads the changed files from the API and hands the
  planners the event pull_request_examples. Files that cannot be read:
  the example legs run (fails open).
- The workflows still start and their summary checks still report, so no
  check is left pending: `Examples Test Summary` and `Examples summary`
  are green for exactly the case "the plan has no example leg and the job
  was skipped", and red when a planned leg failed, was cancelled or did
  not run. In test-python-examples.yml the first job downloads no jars
  when there is no leg.
- The native `pyver` job runs Python 3.11 and 3.14 on a pull request (the
  ends of the range, about a minute each, beside the parity suite). 3.13,
  3.15 and the free-threaded 3.14t stay in the full tier: in 30 days no
  pyver leg was red on a commit whose Linux parity run was green.

What stays on every pull request: the arcadedb-jvm wheel and its tests,
the native image and wheel built from the pull request, and the parity
suite against the installed wheel.
  • Loading branch information
tae898 committed Nov 22, 2026
commit f83a5db5073be8ba3ddae0f9d9fc598763661a64
39 changes: 25 additions & 14 deletions .github/workflows/test-native.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@
#
# A native image build takes about 5 to 30 minutes per platform and the ArcadeData organisation shares a runner cap with
# upstream ArcadeDB, so the load is selective (scripts/select_native_matrix.py holds the legs, tests/test_select_native_matrix.py pins them):
# pull request only when a native path changed (the `paths` filter below); linux-x86_64, Python 3.12 (the fast tier); not for a draft.
# With the label ci:full, or opened by Dependabot: the legs of a push to main (scripts/ci_tier.py)
# pull request only when a native path changed (the `paths` filter below); linux-x86_64, Python 3.12, no example leg (the fast tier);
# not for a draft. The example leg runs when the pull request changes the examples or their runner. With the label
# ci:full, or opened by Dependabot: the legs of a push to main (scripts/ci_tier.py decides all three)
# push to main only when a native path changed; all four platforms, Python 3.12 and 3.14
# nightly all four platforms, Python 3.12 and 3.14, but only when something besides docs changed in the last 25 hours (a full run on Mondays)
# dispatch all four platforms, Python 3.12 and 3.14
# workflow_call from release-native.yml with `release: true`: all four platforms, Python 3.11 to 3.14
# This workflow never publishes: it has no id-token permission and no environment.
#
# Beside the full parity runs, the `pyver` job installs the already built linux-x86_64 wheel (py3-none: no rebuild) into the Pythons the full
# runs of the event leave out (main, nightly, dispatch: 3.11, 3.13; a release: none; a pull request has no `pyver` legs, the fast tier is one Python), into 3.15 (the full suite
# runs of the event leave out (main, nightly, dispatch: 3.11, 3.13; a release: none; a pull request runs only 3.11 and 3.14 of this job), into 3.15 (the full suite
# needs jpype1 and ladybug, which have no cp315 wheel yet, so 3.15 runs without the test files that need jpype1) and into the free-threaded 3.14t, and runs a small subset of the tests there (about 20 s of tests per Python). A release needs it: a leg that passes uploads a marker (native-passed-pyver-py<version>), and release-native.yml
# publishes nothing unless the legs of a release (3.15 and the free-threaded 3.14t) passed. Only linux-x86_64 is checked on them.
# scripts/select_native_matrix.py decides its legs.
#
# The `examples` job runs every script of examples/ against the installed wheel of each platform (Python 3.12 and 3.14; a pull request: linux-x86_64, 3.12), through
# The `examples` job runs every script of examples/ against the installed wheel of each platform (Python 3.12 and 3.14; a pull request: none, or linux-x86_64 on 3.12 when it changes the examples), through
# scripts/run_examples.sh, the runner test-python-examples.yml uses too. scripts/native_examples_skip.txt lists, with a reason, the examples that need the JVM package.
# `examples-summary` is the one check for all its legs. They do not decide what a release publishes (release-native.yml reads the markers and the wheels only).
#
Expand Down Expand Up @@ -234,9 +235,10 @@ jobs:
run: |
set -euo pipefail
run=true
# A pull request runs the fast tier (one platform, one Python). With the label ci:full, or opened by Dependabot, it runs the legs
# of a push to main: scripts/ci_tier.py turns its event into pull_request_full (it reads the labels again from the API, so a re-run
# after adding the label is enough). Every other event passes through unchanged.
# A pull request runs the fast tier (one platform, one Python, no examples). scripts/ci_tier.py turns its event into
# pull_request_examples when it changes the examples or their runner (the example leg too), and into pull_request_full with the
# label ci:full or a Dependabot author (the legs of a push to main; it reads the labels again from the API, so a re-run after
# adding the label is enough). Every other event passes through unchanged.
event="$(python3 -I scripts/ci_tier.py "$EVENT")"
echo "legs of the event: $event"
if [ "$RELEASE" = true ]; then event=release; fi
Expand Down Expand Up @@ -770,7 +772,9 @@ jobs:
name: Examples on the installed wheel (${{ matrix.key }}, Python ${{ matrix.python }})
needs: [plan, build]
# A platform whose build failed has no wheel to download and shows red here; the other platforms still run.
if: ${{ !cancelled() && needs.plan.outputs.run == 'true' }}
# A pull request (the fast tier) has no example leg unless it changes the examples or their runner (scripts/ci_tier.py): the list is
# empty then and the job is skipped, because an empty matrix is an error. `Examples summary` below knows that case.
if: ${{ !cancelled() && needs.plan.outputs.run == 'true' && needs.plan.outputs.examples != '[]' }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 240
defaults:
Expand Down Expand Up @@ -955,6 +959,8 @@ jobs:
retention-days: 3

# One check for the examples of every platform and Python: red when any leg of the `examples` job failed or the job did not run to the end.
# When the plan has no example leg on purpose (the list is `[]`: a pull request, the fast tier) it is green only if the job was skipped.
# An empty list text (the plan step failed half way) is not that case: the job must then have succeeded, so the check is red.
examples-summary:
name: Examples summary
needs: [plan, examples]
Expand All @@ -965,17 +971,22 @@ jobs:
- name: Check the examples legs
env:
RESULT: ${{ needs.examples.result }}
LEGS: ${{ needs.plan.outputs.examples }}
run: |
want=success
if [ "$LEGS" = '[]' ]; then want=skipped; fi
{
echo "## Examples on the installed wheel"
echo
if [ "$RESULT" = success ]; then
echo "All example legs passed."
if [ "$RESULT" != "$want" ]; then
echo "The examples job ended with: $RESULT (expected: $want). See the legs of the job \"Examples on the installed wheel\"."
elif [ "$want" = skipped ]; then
echo "No example leg in this run: a pull request runs the examples only when it changes them or their runner, or carries the label ci:full."
else
echo "The examples job ended with: $RESULT. See the legs of the job \"Examples on the installed wheel\"."
echo "All example legs passed."
fi
} >> "$GITHUB_STEP_SUMMARY"
[ "$RESULT" = success ]
[ "$RESULT" = "$want" ]

# The cheap Python-version coverage of the wheel of linux-x86_64 (py3-none: the same file for every Python, nothing is rebuilt): a subset of
# the test files, not the whole suite. The legs are the supported Pythons the full parity runs of this event leave out, plus the
Expand All @@ -990,8 +1001,8 @@ jobs:
name: Python ${{ matrix.python }} on the wheel (linux-x86_64)
needs: [plan, build]
# The linux-x86_64 build may have failed: then there is no wheel to download and this shows red, as the test job does.
# A pull request (the fast tier) has no legs here: the list is empty and the job is skipped, because an empty matrix is an error.
# No other job needs this one, so a skipped pyver job changes no summary.
# Skipped when the list is empty, because an empty matrix is an error (every event has legs today: a pull request the oldest and the
# newest Python). No other job needs this one, so a skipped pyver job changes no summary.
if: ${{ !cancelled() && needs.plan.outputs.run == 'true' && needs.plan.outputs.pyver != '[]' }}
runs-on: ubuntu-latest
timeout-minutes: 20
Expand Down
71 changes: 47 additions & 24 deletions .github/workflows/test-python-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,23 @@ jobs:
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
outputs:
arcadedb-tag: ${{ steps.jars.outputs.arcadedb-tag }}
# "true" when this run has example legs, "false" when it has none on purpose (a pull request, the fast tier)
run: ${{ steps.matrix.outputs.run }}
matrix: ${{ steps.matrix.outputs.matrix }}
wheel-matrix: ${{ steps.matrix.outputs.wheel-matrix }}
steps:
- name: Checkout code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1

# The platform x Python legs of this run (scripts/select_matrix.py). A pull request runs
# the fast tier (linux/amd64, the newest Python); every other event runs the full matrix.
# The organisation shares one runner cap with ArcadeData/arcadedb, so a pull request does
# not wait for the macOS and Windows runners. A pull request with the label ci:full, and
# one Dependabot opened, runs the legs of a push to main: scripts/ci_tier.py turns its
# event into pull_request_full (it reads the labels again from the API, so a re-run after
# adding the label is enough).
# the fast tier, which has NO example leg: the examples are the slowest jobs (20 to 30
# minutes), so they run on a push to main, in the nightly run and on a manual run. The
# matrix is then empty, `run` is false, the rest of this job and the two jobs below are
# skipped, and the summary job says so and stays green. A pull request that changes the
# examples or their runner runs the leg of linux/amd64 on the newest Python
# (pull_request_examples). A pull request with the label ci:full, and one Dependabot
# opened, runs the legs of a push to main (pull_request_full). scripts/ci_tier.py decides:
# it reads the labels again from the API, so a re-run after adding the label is enough.
# The wheel matrix is the platforms of those legs, one build each: the wheel is
# py3-none-<platform>, the same file for every Python.
# Done first, so a failure here costs no Docker pull.
Expand All @@ -166,11 +170,17 @@ jobs:
echo "$wheel_matrix"
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
echo "wheel-matrix=$wheel_matrix" >> "$GITHUB_OUTPUT"
# An empty matrix is an error for a job, so the jobs that take it are skipped when there is no leg
if [ "$matrix" = '{"include":[]}' ]; then run=false; else run=true; fi
echo "example legs in this run: $run"
echo "run=$run" >> "$GITHUB_OUTPUT"

- name: Set up Docker Buildx
if: steps.matrix.outputs.run == 'true'
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1

- name: Download JARs from ArcadeDB Docker image
if: steps.matrix.outputs.run == 'true'
id: jars
shell: bash
run: |
Expand Down Expand Up @@ -210,6 +220,7 @@ jobs:
# Unfiltered on purpose: build-native.sh applies scripts/jar_exclusions.txt
# to whatever lands in the jars directory, so the list lives in one place.
- name: Upload JARs as artifact
if: steps.matrix.outputs.run == 'true'
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: arcadedb-jars-examples
Expand All @@ -224,7 +235,7 @@ jobs:
name: Build wheel for examples (${{ matrix.platform }})
runs-on: ${{ matrix.runs-on }}
needs: download-jars
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
if: (github.event_name != 'pull_request' || github.event.pull_request.draft == false) && needs.download-jars.outputs.run == 'true'
env:
BUILD_VERSION: ${{ inputs.build-version }}
strategy:
Expand Down Expand Up @@ -329,7 +340,7 @@ jobs:
name: Test Python Examples (${{ matrix.platform }}, Python ${{ matrix.python-version }})
runs-on: ${{ matrix.runs-on }}
needs: [download-jars, build]
if: github.event_name != 'pull_request' || github.event.pull_request.draft == false
if: (github.event_name != 'pull_request' || github.event.pull_request.draft == false) && needs.download-jars.outputs.run == 'true'
env:
# Pin the Hugging Face cache inside the workspace so it is cacheable with
# one path on every platform (the default differs per OS). The examples
Expand Down Expand Up @@ -585,31 +596,43 @@ jobs:
if-no-files-found: ignore
retention-days: 14

# Summary job that checks every leg this run started. The legs are a matrix, so the result of the job is "success" only when
# every leg of it passed, whatever their number: one leg on a pull request (the fast tier), 16 on the other events. A leg that
# failed, was cancelled or never started (its build failed) makes the result something else, and this job red.
# Summary job that checks every leg this run started, and the one check that always reports for this workflow.
# - The run has example legs (`run` is true): green only when the build and the example legs both ended with "success". They are
# matrix jobs, so the result is one word for the whole matrix whatever the number of legs; a leg that failed, was cancelled or
# never started (its build failed) makes it something else, and this job red.
# - The run has no example leg on purpose (`run` is false: a pull request, the fast tier): green only when the first job
# succeeded and both jobs were skipped.
# - Anything else is red: the first job failed, `run` is empty, or a job that should have been skipped ran.
test-examples-summary:
name: Examples Test Summary
needs: [build, test-examples]
needs: [download-jars, build, test-examples]
runs-on: ubuntu-latest
# Skipped (not red) when the matrix was skipped for a draft PR.
if: always() && (github.event_name != 'pull_request' || github.event.pull_request.draft == false)
steps:
- name: Check test results
shell: bash
env:
PLAN: ${{ needs.download-jars.result }}
RUN: ${{ needs.download-jars.outputs.run }}
BUILD: ${{ needs.build.result }}
LEGS: ${{ needs.test-examples.result }}
run: |
echo "## 🎯 Overall Examples Test Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ "${{ needs.build.result }}" = "success" ] && [ "${{ needs.test-examples.result }}" = "success" ]; then
echo "✅ **Every leg of this run passed example testing!**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "All examples ran successfully on every leg this run started, against one wheel built for each platform." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Legs**: a pull request runs linux/amd64 only (the fast tier). A push to main, the nightly run, a manual run and a pull request with the label ci:full run linux/amd64, linux/arm64, darwin/arm64 and windows/amd64. The jobs of this run list its legs." >> $GITHUB_STEP_SUMMARY
echo "## 🎯 Overall Examples Test Summary" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "first job: $PLAN, example legs in this run: ${RUN:-unknown}, build: $BUILD, examples: $LEGS"

if [ "$PLAN" = success ] && [ "$RUN" = false ] && [ "$BUILD" = skipped ] && [ "$LEGS" = skipped ]; then
echo "⏭️ **No example leg in this run**" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "A pull request runs the examples only when it changes them or their runner, or carries the label ci:full. A push to main, the nightly run and a manual run run them on every platform." >> "$GITHUB_STEP_SUMMARY"
elif [ "$PLAN" = success ] && [ "$RUN" = true ] && [ "$BUILD" = success ] && [ "$LEGS" = success ]; then
echo "✅ **Every leg of this run passed example testing!**" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "All examples ran successfully on every leg this run started, against one wheel built for each platform. The jobs of this run list its legs." >> "$GITHUB_STEP_SUMMARY"
else
echo "❌ **Some legs failed example testing**" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Please check the individual platform jobs for details." >> $GITHUB_STEP_SUMMARY
echo "❌ **Some legs failed example testing**" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "Please check the individual platform jobs for details." >> "$GITHUB_STEP_SUMMARY"
exit 1
fi
8 changes: 5 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,13 @@ shellcheck and hadolint run as `docker_image` hooks (Docker pulls the images aut

CI has two tiers, so that a pull request does not wait for the macOS and Windows runners that the organisation shares with ArcadeData/arcadedb.

- **A pull request runs the fast tier.** The static checks (pre-commit, Bandit, the dependency audits) run as before. The builds and tests run on Linux x86-64 only: the `arcadedb-jvm` wheel with the tests on Python 3.11 and 3.14 and the examples on Python 3.14 and, when a native path changed, the native image and wheel with the tests and the examples on Python 3.12. A pull request that changes only documentation runs no platform job.
- **`main` runs the full tier.** A push to `main` and the nightly run (03:00 to 04:00 UTC) test all four platforms: Linux x86-64, Linux arm64, macOS arm64 and Windows x86-64. A release tests every platform on every Python version.
- **A pull request runs the fast tier.** The static checks (pre-commit, Bandit, the dependency audits) run as before. The builds and tests run on Linux x86-64 only: the `arcadedb-jvm` wheel with the tests on Python 3.11 and 3.14 and, when a native path changed, the native image and wheel with the parity suite on Python 3.12 and a short subset on Python 3.11 and 3.14. The examples do not run, unless the pull request changes a file under `examples/` or their runner (`scripts/run_examples.sh`, `scripts/native_examples_skip.txt`). A pull request that changes only documentation runs no platform job.
- **`main` runs the full tier.** A push to `main` and the nightly run (03:00 to 04:00 UTC) test all four platforms (Linux x86-64, Linux arm64, macOS arm64 and Windows x86-64) and run the examples on each. A release tests every platform on every Python version.
- **To run the full tier on a pull request**, add the label `ci:full`, then push a commit or choose "Re-run all jobs" on its test workflows. The pull request then runs what a push to `main` runs. Use it for a change that can behave differently on another platform: file paths, processes and signals, the wheel build, the native library, a workflow file. If you cannot add labels, ask for it in the pull request. Dependabot pull requests always run the full tier.

A problem that only another platform shows is found on `main` after the merge: the badges at the top of the README turn red, and the fix or the revert comes before the next release. [Continuous integration](docs/modules/ROOT/pages/development/ci.adoc) lists the legs of each event.
The wait of a pull request is set by the native image build and the parity suite that follows it. A pull request that changes no native path waits for the `arcadedb-jvm` tests only.

A problem that only another platform or an example shows is found on `main` after the merge: the badges at the top of the README turn red, and the fix or the revert comes before the next release. [Continuous integration](docs/modules/ROOT/pages/development/ci.adoc) lists the legs of each event.

A commit message starts with a short subject that says what changes and where, for example `Native find_nearest: send the query vector as one float32 array, not a Python list`. The body says why. Link the issue with `Closes #N` in the pull request.

Expand Down
Loading
Loading