Files
LocalAI/.github/workflows/addons-tests.yml
T
mudler-agentandEttore Di Giacinto 8b4f3c35e8 fix(ci): use native workflow path filters (#13037)
* ci: select affected checks and share add-on builds

Keep validation check identities present while omitting expensive steps
when explicit dependency rules prove they are unaffected. Unknown inputs
and diff failures retain broad validation.

Select add-on package legs on PRs and master without weakening catalog
checks or changing release publishing. Manual package runs validate only,
including their reusable Sandbox guest image dependency.

Share bounded, same-run production fixtures across the five add-on test
groups. Verify checkout identity, tools, paths, modes and checksums before
using them. Keep instrumented coverage builds separate.

Assisted-by: nib:gpt-6.1-sol
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* fix(ci): validate documentation test contracts

Documentation is executable input to Tables, recovery, diagnostics,
gallery and other add-on tests. Select all domains for docs changes
instead of treating the whole directory as inert. Cover known readers,
unfamiliar paths and deleted guides in classifier regression fixtures.

Assisted-by: nib:gpt-6.1-sol
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* fix(ci): gate affected jobs before allocation

Classify each workflow once and gate whole expensive jobs. Limit add-on
matrices to affected packages and host groups instead of allocating all
runners before deciding whether their steps should run.

Select documentation readers explicitly and derive host consumers from
local Go imports. Keep unknown source inputs conservative. Preserve
coverage, production fixtures, publish locks and manual full validation.
Remove the unrequested weekly schedules.

Reject classifier failures and unexpected dependency skips in stable
aggregate checks. Document required-check migration without claiming
access to protected-branch settings. Test actual YAML job and matrix
eligibility against representative paths and the original triggers.

Assisted-by: nib:gpt-6.1-sol
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* fix(ci): validate executable and fixture seams

Include executed fixture binaries and their production imports in host
selection. Lexical Go imports alone miss the mock backend started by
the UI test server and add-on suites.

Rebase restored artifact timestamps only after identity and checksum
validation. Preserve the existing stale-source checks across a later
consumer checkout and reject subsequent source edits.

Validate package plan outputs before allowing dependency skips. Missing
or malformed plans must not turn failed publication preparation green.
Cover all three review findings with before-fix reproductions and
actual workflow eligibility regressions.

Assisted-by: nib:gpt-6.1-sol
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* fix(ci): use native workflow path filters

Replace calculated dependencies with visible PR and master path lists.
Run complete area suites without classifier runners or result plumbing.
Restore original packaging validation and publication dependencies.

Keep one production fixture build for the five original add-on groups.
Verify artifact identity and freshness without changing suite inventories.
Document allowlist maintenance and required-check migration limits.

Assisted-by: nib:gpt-6.1-sol
Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Co-authored-by: Ettore Di Giacinto <mudler@localai.io>
2026-11-02 21:16:37 +01:00

211 lines
7.2 KiB
YAML

---
name: 'Add-on Tests'
# Runs the suites of scripts/addons/suites.json: the add-on contract, gateway,
# policy, recovery, upgrade and host-slot suites, the add-on library sources,
# the Tables suites and the browser specs of the add-on pages. verify.sh checks
# each suite against its exact case inventory and fails on a skipped, flaky or
# missing case.
#
# The Go tests under addons/ and the tests/addons/actione2e suite run in the
# main test workflow (make test, make test-coverage-check). The packaging suite
# runs in addons-package.yml. The UI unit tests of every add-on run in
# tests-ui-unit.yml.
on:
pull_request:
paths:
- 'addons/**'
- 'go.mod'
- 'go.sum'
- '.github/workflows/addons-tests.yml'
- 'core/**'
- 'pkg/**'
- 'cmd/**'
- 'internal/**'
- 'backend/go/**'
- 'backend/*.proto'
- 'backend/*/*.proto'
- 'tests/**'
- 'configuration/**'
- 'swagger/**'
- 'prompt-templates/**'
- 'gallery/addons/**'
- 'docs/content/features/addons.md'
- 'docs/content/features/tables.md'
- 'Makefile'
- 'scripts/**'
- '.github/actions/**'
push:
branches: [master]
paths:
- 'addons/**'
- 'go.mod'
- 'go.sum'
- '.github/workflows/addons-tests.yml'
- 'core/**'
- 'pkg/**'
- 'cmd/**'
- 'internal/**'
- 'backend/go/**'
- 'backend/*.proto'
- 'backend/*/*.proto'
- 'tests/**'
- 'configuration/**'
- 'swagger/**'
- 'prompt-templates/**'
- 'gallery/addons/**'
- 'docs/content/features/addons.md'
- 'docs/content/features/tables.md'
- 'Makefile'
- 'scripts/**'
- '.github/actions/**'
concurrency:
group: ci-addons-tests-${{ github.event.pull_request.number || github.sha }}-${{ github.repository }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
jobs:
prepare:
name: prepare shared production fixtures
runs-on: ubuntu-24.04
timeout-minutes: 60
steps:
- name: Clone
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@v6
with:
# prepare.sh accepts Go 1.26.x only and runs with GOTOOLCHAIN=local.
go-version: '1.26.x'
cache: false
- name: Setup Node.js
uses: actions/setup-node@v7
with:
# prepare.sh accepts Node 22.12 or later within Node 22.
node-version: '22'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libopus-dev unzip curl
- name: Install protoc
# prepare.sh requires exactly libprotoc 26.1.
run: |
curl -L -s https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-x86_64.zip -o protoc.zip
sudo unzip -j -d /usr/local/bin protoc.zip bin/protoc
rm protoc.zip
protoc --version
- name: Prepare the build toolchain
# The producer installs build inputs only; consumers install Chromium.
run: sh scripts/addons/prepare.sh --prepare-build
- name: Build the UI, the mock backend and the UI test server
run: COVERAGE=false COVERAGE_V8=false sh scripts/addons/prepare.sh --integration
- name: Archive production fixtures
run: |
python3 scripts/ci/fixtures.py pack
- uses: actions/upload-artifact@v7
with:
name: addon-production-fixtures
path: ${{ runner.temp }}/addon-fixtures.tgz
if-no-files-found: error
retention-days: 1
suites:
needs: prepare
name: ${{ matrix.group }}
runs-on: ubuntu-24.04
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
# Go suites over the owner, the carrier, the gateway and the policy.
- group: contracts and gateway
suites: prerequisites contracts catalog packages lifecycle runtime gateway policy proposals artifacts apps
# Browser suites over the host pages of the add-ons.
- group: host pages
suites: gallery-ui esm-ui host-slots library-sources updates recovery
# Two frontends and an owner, with real authentication.
- group: foundation
suites: foundation-acceptance
# The Tables add-on: stores, tools and administration.
- group: tables
suites: tables-databases tables-schema tables-rows tables-tools tables-admin
# The Tables add-on: pages, CSV export and the end-to-end acceptance.
- group: tables pages
suites: tables-ui tables-csv tables-acceptance
steps:
- name: Clone
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Setup Go
uses: actions/setup-go@v6
with:
# prepare.sh accepts Go 1.26.x only and runs with GOTOOLCHAIN=local.
go-version: '1.26.x'
cache: false
- name: Setup Node.js
uses: actions/setup-node@v7
with:
# prepare.sh accepts Node 22.12 or later within Node 22.
node-version: '22'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libopus-dev unzip curl
- name: Install protoc
# prepare.sh requires exactly libprotoc 26.1.
run: |
curl -L -s https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-x86_64.zip -o protoc.zip
sudo unzip -j -d /usr/local/bin protoc.zip bin/protoc
rm protoc.zip
protoc --version
- name: Prepare the toolchain
# Downloads the Go modules, installs the pinned protobuf plugins, runs
# npm ci and installs the Playwright Chromium. Nothing later reaches
# the network.
run: sh scripts/addons/prepare.sh --prepare
- name: Install the browser's system libraries
run: sudo env "PATH=$PATH" core/http/react-ui/node_modules/.bin/playwright install-deps chromium
- uses: actions/download-artifact@v8
with:
name: addon-production-fixtures
path: ${{ runner.temp }}
- name: Restore and check production fixtures
run: |
python3 scripts/ci/fixtures.py unpack
sh scripts/addons/prepare.sh --check
- name: Run the suites
env:
SUITES: ${{ matrix.suites }}
run: |
failed=""
for suite in $SUITES; do
echo "::group::$suite"
if ! sh scripts/addons/verify.sh "$suite"; then
failed="$failed $suite"
echo "::error::suite $suite failed"
fi
echo "::endgroup::"
done
if [ -n "$failed" ]; then
echo "failed suites:$failed" >&2
exit 1
fi
- name: Upload the suite logs
if: ${{ failure() }}
uses: actions/upload-artifact@v7
with:
name: addons-suite-logs-${{ strategy.job-index }}
path: |
.cache/addons/logs/
core/http/react-ui/playwright-report/
core/http/react-ui/test-results/
if-no-files-found: ignore
retention-days: 7