mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-06 04:23:15 -05:00
Many pushes to master left over a hundred runs queued, because every push used its own concurrency group. Group push runs by ref and cancel the in-flight run on master for the test, lint and E2E workflows. PR, tag, schedule and dispatch runs keep groups that a master push cannot cancel. The intel cache job pushes one fixed tag, so it now keeps at most one pending run per event and never cancels a running build. image.yml and backend.yml are unchanged: they build from the diff of a single push, so replacing a queued run could skip a code commit. Document the policy in .agents/ci-caching.md. Assisted-by: Claude:claude-sonnet-5-5 python3
112 lines
3.7 KiB
YAML
112 lines
3.7 KiB
YAML
---
|
|
# Concurrency policy: a newer push to master cancels the in-flight run of this
|
|
# workflow on master, because the newer commit contains the older one and the
|
|
# result that matters is the newest. PR runs group by PR number (as before),
|
|
# tag pushes group by their own tag ref, and schedule/dispatch runs group by
|
|
# commit SHA, so none of those is ever cancelled by a master push.
|
|
# See .agents/ci-caching.md, section "Concurrency".
|
|
name: 'E2E Backend Tests'
|
|
|
|
on:
|
|
pull_request:
|
|
paths:
|
|
- 'core/**'
|
|
- 'pkg/**'
|
|
- 'cmd/**'
|
|
- 'internal/**'
|
|
- 'backend/go/**'
|
|
- 'backend/*.proto'
|
|
- 'backend/*/*.proto'
|
|
- 'addons/**'
|
|
- 'tests/**'
|
|
- 'configuration/**'
|
|
- 'swagger/**'
|
|
- 'prompt-templates/**'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- 'Makefile'
|
|
- 'scripts/**'
|
|
- '.github/actions/**'
|
|
- '.github/workflows/tests-e2e.yml'
|
|
push:
|
|
branches: [master]
|
|
tags: ['*']
|
|
paths:
|
|
- 'core/**'
|
|
- 'pkg/**'
|
|
- 'cmd/**'
|
|
- 'internal/**'
|
|
- 'backend/go/**'
|
|
- 'backend/*.proto'
|
|
- 'backend/*/*.proto'
|
|
- 'addons/**'
|
|
- 'tests/**'
|
|
- 'configuration/**'
|
|
- 'swagger/**'
|
|
- 'prompt-templates/**'
|
|
- 'go.mod'
|
|
- 'go.sum'
|
|
- 'Makefile'
|
|
- 'scripts/**'
|
|
- '.github/actions/**'
|
|
- '.github/workflows/tests-e2e.yml'
|
|
|
|
concurrency:
|
|
group: ci-tests-e2e-backend-${{ github.event.pull_request.number || (github.event_name == 'push' && github.ref) || github.sha }}-${{ github.repository }}
|
|
cancel-in-progress: ${{ github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/master') }}
|
|
|
|
jobs:
|
|
tests-e2e-backend:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
go-version: ['1.25.x']
|
|
steps:
|
|
- name: Clone
|
|
uses: actions/checkout@v7
|
|
with:
|
|
submodules: true
|
|
- name: Configure apt mirror on runner
|
|
uses: ./.github/actions/configure-apt-mirror
|
|
- name: Setup Go ${{ matrix.go-version }}
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ matrix.go-version }}
|
|
cache: false
|
|
- name: Display Go version
|
|
run: go version
|
|
- name: Proto Dependencies
|
|
run: |
|
|
# Install protoc
|
|
curl -L -s https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-x86_64.zip -o protoc.zip && \
|
|
unzip -j -d /usr/local/bin protoc.zip bin/protoc && \
|
|
rm protoc.zip
|
|
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.34.2
|
|
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@1958fcbe2ca8bd93af633f11e97d44e567e945af
|
|
PATH="$PATH:$HOME/go/bin" make protogen-go
|
|
- name: Dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y build-essential libopus-dev
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '22'
|
|
- name: Build React UI
|
|
run: make react-ui
|
|
- name: Test Backend E2E
|
|
run: |
|
|
PATH="$PATH:$HOME/go/bin" make build-mock-backend test-e2e
|
|
# tmate keeps the runner busy until the 6 hour job limit, so a single
|
|
# failure costs a whole runner slot. Only open a session when someone
|
|
# asked for one by labelling the pull request `ci-debug`, and cap the
|
|
# session so a forgotten label cannot idle a runner either.
|
|
- name: Setup tmate session if tests fail
|
|
if: ${{ failure() && contains(github.event.pull_request.labels.*.name, 'ci-debug') }}
|
|
timeout-minutes: 30
|
|
uses: mxschmitt/action-tmate@v3.23
|
|
with:
|
|
detached: true
|
|
connect-timeout-seconds: 180
|
|
limit-access-to-actor: true
|