Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 7 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ on:

jobs:
build:
name: Build
name: Build ${{ matrix.platform }}
runs-on: sprinters:aws:ubuntu-24.04-arm:c7gd.xlarge
strategy:
matrix:
platform: [miyoomini, tg5040]
fail-fast: false

steps:
- name: Checkout code
Expand All @@ -28,8 +32,5 @@ jobs:
sudo apt-get update
sudo apt-get install -y jq

- name: Build miyoomini (arm64 native)
run: make PLATFORM=miyoomini build

- name: Build trimuismart (amd64 emulation verification)
run: make PLATFORM=trimuismart build
- name: Build ${{ matrix.platform }}
run: make PLATFORM=${{ matrix.platform }} build
67 changes: 58 additions & 9 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,79 @@ on:
pull_request:
branches: [main, develop]

permissions:
contents: read
packages: write

jobs:
lint:
name: Lint
docker-build:
name: Build Dev Container
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Calculate Dockerfile hash
id: dockerfile-hash
run: |
HASH=$(sha256sum Dockerfile | awk '{print $1}')
echo "hash=$HASH" >> $GITHUB_OUTPUT
echo "Dockerfile hash: $HASH"

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
submodules: true
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Check if image exists in GHCR
id: check-image
run: |
IMAGE="ghcr.io/lessui-hq/lessui-dev:${{ steps.dockerfile-hash.outputs.hash }}"
if docker manifest inspect "$IMAGE" >/dev/null 2>&1; then
echo "✓ Image exists in GHCR (skipping build)"
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "Image not found, will build"
echo "exists=false" >> $GITHUB_OUTPUT
fi

- name: Set up Docker Buildx
if: steps.check-image.outputs.exists == 'false'
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
if: steps.check-image.outputs.exists == 'false'
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: |
ghcr.io/lessui-hq/lessui-dev:${{ steps.dockerfile-hash.outputs.hash }}
ghcr.io/lessui-hq/lessui-dev:latest
cache-from: type=gha
cache-to: type=gha,mode=max

lint:
name: Lint
needs: docker-build
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true

- name: Run all linting checks
run: make lint

analyze:
name: Static Analysis
needs: docker-build
runs-on: ubuntu-latest

steps:
Expand All @@ -33,14 +87,12 @@ jobs:
with:
submodules: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run Clang Static Analyzer
run: make analyze

test:
name: Test
needs: docker-build
runs-on: ubuntu-latest

steps:
Expand All @@ -49,8 +101,5 @@ jobs:
with:
submodules: true

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Run all tests
run: make test
22 changes: 19 additions & 3 deletions Makefile.qa
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# The main makefile forwards to this file for test/lint/format targets.
# Run 'make -f Makefile.qa help' for complete target list.

.PHONY: help lint lint-code lint-full lint-shell analyze analyze-native test test-native test-asan test-asan-native format format-native format-check format-shell format-shell-check format-make format-make-check format-prettier format-prettier-check clean-qa clean-tests docker-build docker-test docker-test-asan docker-lint docker-analyze docker-format docker-format-check docker-shell lint-native report coverage docker-coverage clean-coverage
.PHONY: help lint lint-code lint-full lint-shell analyze analyze-native test test-native test-asan test-asan-native format format-native format-check format-shell format-shell-check format-make format-make-check format-prettier format-prettier-check clean-qa clean-tests docker-build docker-pull docker-test docker-test-asan docker-lint docker-analyze docker-format docker-format-check docker-shell lint-native report coverage docker-coverage clean-coverage

help:
@echo "LessUI Quality Assurance Tools"
Expand Down Expand Up @@ -811,12 +811,28 @@ report: check-clang-tidy
###########################################################
# Docker QA (recommended for consistency with CI)
DEV_IMAGE = lessui-dev
GHCR_IMAGE = ghcr.io/lessui-hq/lessui-dev:latest
DEV_RUN = docker run --rm -v $(shell pwd):/lessui -w /lessui $(DEV_IMAGE)

# Set FORCE_DOCKER_BUILD=1 to build locally instead of pulling from GHCR
FORCE_DOCKER_BUILD ?= 0

# Pull prebuilt image from GHCR and tag it locally
docker-pull:
@echo "Pulling dev image from GHCR..."
@docker pull $(GHCR_IMAGE)
@docker tag $(GHCR_IMAGE) $(DEV_IMAGE)
@echo "✓ Dev image ready (from GHCR)"

# Default: pull from GHCR. Use FORCE_DOCKER_BUILD=1 to build locally.
docker-build:
@echo "Building dev Docker image (Ubuntu 24.04, matches GitHub CI)..."
ifeq ($(FORCE_DOCKER_BUILD),1)
@echo "Building dev Docker image locally..."
@docker build -q -t $(DEV_IMAGE) -f Dockerfile .
@echo "✓ Dev image ready"
@echo "✓ Dev image ready (built locally)"
else
@$(MAKE) -f Makefile.qa docker-pull
endif

docker-test: docker-build
@echo "Running tests in Docker container (Ubuntu 24.04)..."
Expand Down
1 change: 0 additions & 1 deletion workspace/all/common/gl_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "libretro.h"
#include "log.h"
#include "scaler.h" // For scaling constants/types if needed
#include <SDL.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion workspace/all/common/gl_video.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

#if HAS_OPENGLES

#include <SDL.h>
#include "sdl.h"
#include <stdbool.h>

// Forward declarations to avoid including libretro.h in non-player components
Expand Down