Skip to content

Merge branch 'master' of github.com:nanorele/rete #53

Merge branch 'master' of github.com:nanorele/rete

Merge branch 'master' of github.com:nanorele/rete #53

Workflow file for this run

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
# Single gate that decides whether downstream jobs run. Centralises
# fork-protection so each new job only needs `needs: gate` — no
# duplicated `if:` blocks. Runs on a GitHub-hosted runner so forked
# PRs never reach the self-hosted infrastructure even to evaluate the
# condition; if the gate is skipped, every dependent job is skipped
# transitively.
gate:
name: Gate · trusted source check
runs-on: ubuntu-latest
if: >-
github.event_name == 'push' || (
github.event.pull_request.head.repo.full_name == github.repository
&& github.actor != 'dependabot[bot]'
&& contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.pull_request.author_association)
)
steps:
- run: echo "Trusted source — downstream jobs are allowed to run."
build-test-lint:
needs: gate
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.5'
cache: true
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
gcc \
libwayland-dev \
libx11-dev \
libx11-xcb-dev \
libxkbcommon-x11-dev \
libgles2-mesa-dev \
libegl1-mesa-dev \
libffi-dev \
libxcursor-dev \
libvulkan-dev
- name: Lint (go vet)
run: go vet ./...
- name: Build
run: go build -v -o bin/tracto ./cmd
- name: Run tests
run: go test -cover ./...
ui-screenshots:
needs: gate
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.25.5'
cache: true
- name: Install GUI build deps + software GL (llvmpipe)
run: |
sudo apt-get update
sudo apt-get install -y \
gcc \
libwayland-dev \
libx11-dev \
libx11-xcb-dev \
libxkbcommon-x11-dev \
libgles2-mesa-dev \
libegl1-mesa-dev \
libffi-dev \
libxcursor-dev \
libvulkan-dev \
libgl1-mesa-dri \
libegl-mesa0 \
mesa-vulkan-drivers
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
# requirements.txt is matched by the repo's root `.gitignore` (*.txt), so it
# is never checked out — install the deps inline instead of via -r.
- name: Install Python deps
run: pip install numpy opencv-python
# gpu/headless has no software rasterizer; on this CPU-only Ubuntu 24
# runner Mesa's llvmpipe provides a software EGL context (surfaceless,
# no X/Wayland display needed).
- name: Render screenshots
env:
LIBGL_ALWAYS_SOFTWARE: '1'
GALLIUM_DRIVER: llvmpipe
EGL_PLATFORM: surfaceless
run: go test -tags screenshots ./internal/ui -run TestScreenshots -count=1 -v
# Structural + non-blank checks are backend-tolerant. Golden pixel-diff
# is opt-in: it activates only when Linux baselines exist under
# golden-linux/ (generated on this runner), since the committed golden/
# images come from a different GPU backend and won't pixel-match.
- name: Verify layout (contours + non-blank)
run: python tools/uitest/verify.py --golden internal/ui/testdata/screenshots/golden-linux
- name: Upload screenshots & report
if: always()
uses: actions/upload-artifact@v4
with:
name: ui-screenshots
path: |
internal/ui/testdata/screenshots/*.png
internal/ui/testdata/screenshots/*.layout.json
internal/ui/testdata/screenshots/report.html
internal/ui/testdata/screenshots/annotated
internal/ui/testdata/screenshots/diff
if-no-files-found: error