Skip to content
Open
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
23 changes: 20 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ on:
required: true
type: number
default: 0
riscv64_count:
description: 'Number of riscv64 (QEMU) runners'
required: true
type: number
default: 0

defaults:
run:
Expand All @@ -46,8 +51,14 @@ jobs:
run: |
X86=$(seq 1 "${{ github.event.inputs.x86_64_count }}" | jq -cs '[.[] | {"os":"ubuntu-latest", "runner_id":.}]')
ARM=$(seq 1 "${{ github.event.inputs.aarch64_count }}" | jq -cs '[.[] | {"os":"ubuntu-24.04-arm", "runner_id":.}]')
echo "matrix=$(jq -cn --argjson a "$X86" --argjson b "$ARM" '{include: ($a + $b)}')" >> $GITHUB_OUTPUT
echo "matrix_count=$(( ${{ github.event.inputs.x86_64_count }} + ${{ github.event.inputs.aarch64_count }} ))" >> $GITHUB_OUTPUT
RISCV=$(seq 1 "${{ github.event.inputs.riscv64_count }}" | jq -cs '[.[] | {"os":"ubuntu-latest", "runner_id":., "riscv":true}]')
#echo "matrix=$(jq -cn --argjson a "$X86" --argjson b "$ARM" '{include: ($a + $b)}')" >> $GITHUB_OUTPUT
#echo "matrix_count=$(( ${{ github.event.inputs.x86_64_count }} + ${{ github.event.inputs.aarch64_count }} ))" >> $GITHUB_OUTPUT
echo "matrix=$(jq -cn --argjson a "$X86" --argjson b "$ARM" --argjson c "$RISCV" '{include: ($a + $b + $c)}')" >> $GITHUB_OUTPUT
echo "matrix_count=$(( \
${{ github.event.inputs.x86_64_count }} + \
${{ github.event.inputs.aarch64_count }} + \
${{ github.event.inputs.riscv64_count }} ))" >> $GITHUB_OUTPUT
WINX86=$(seq 1 "${{ github.event.inputs.win_x86_64_count }}" | jq -cs '[.[] | {"os":"windows-latest", "runner_id":.}]')
echo "matrix_win=$(jq -cn --argjson a "$WINX86" '{include: ($a)}')" >> $GITHUB_OUTPUT
echo "matrix_win_count=$(( ${{ github.event.inputs.win_x86_64_count }} ))" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -95,7 +106,11 @@ jobs:
chmod +x runner
- name: Register Runner
run: |
if [[ "$(uname -m)" == "aarch64" ]]; then
#if [[ "${{ matrix.riscv }}" == "true" ]]; then
if [[ "${{ matrix.riscv || false }}" == "true" ]]; then
printf '%s\n' '${{ secrets.RUNNER_REGISTRATION_X86_64 }}' > .runner
mv config_riscv64.yaml config.yaml
elif [[ "$(uname -m)" == "aarch64" ]]; then
printf '%s\n' '${{ secrets.RUNNER_REGISTRATION_AARCH64 }}' > .runner
mv config_aarch64.yaml config.yaml
else
Expand All @@ -122,13 +137,15 @@ jobs:
- name: Get Internal Env-Vars
uses: crazy-max/ghaction-github-runtime@v3
- name: Start Cacheproxy
if: ${{ !env.ACT }}
run: |
./cacheproxy/genconfig.sh
docker network create runnernet
docker run --rm --pull=always -d --network runnernet --name cacheproxy -v ./cacheproxy:/etc/caddy caddy:2
echo "ACTIONS_CACHE_URL_V2=http://cacheproxy:8080/" >> .env
echo "ACTIONS_CACHE_SERVICE_V2=1" >> .env
- name: Run Runner
if: ${{ !env.ACT }}
id: runner
run: |
RUNNER_RET=0
Expand Down
12 changes: 12 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends: default

rules:
document-start: disable
truthy:
allowed-values: ['true', 'false']
check-keys: false
line-length:
max: 300
allow-non-breakable-words: true
allow-non-breakable-inline-mappings: true

52 changes: 52 additions & 0 deletions config_riscv64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
# RISC-V CI runner configuration
#
# Host platform: linux/amd64
# Target platform: linux/riscv64 (emulated)
#
# Purpose:
# - Enable RISC-V (riscv64) CI builds on x86_64 hosts
# - Uses Docker + cross-compilation + QEMU (no native RISC-V hardware required)
#
# How it works:
# - Runner executes inside an amd64 Docker container
# - RISC-V binaries are cross-compiled using riscv64-linux-gnu toolchain
# - Smoke tests are executed using qemu-riscv64
#
# Docker image:
# - while1skothadiya/ffmpeg-riscv-docker:latest
# (contains toolchain, QEMU, and a statically-built FFmpeg)
# - FFmpeg binary is statically linked to avoid runtime loader dependencies
# Notes:
# - This runner is NOT a native RISC-V environment
# - Label "linux-riscv64" is logical and used for job routing only
# - Privileged mode and host binfmt are intentionally avoided

log:
level: info
job_level: info

runner:
file: .runner
env_file: .env
capacity: 1
timeout: 3h
shutdown_timeout: 1h
insecure: false
fetch_timeout: 5s
labels:
- "linux-riscv64:docker://while1skothadiya/ffmpeg-riscv-docker:latest"

cache:
enabled: true
dir: /var/actcache

host:
workdir_parent: /var/act

container:
network: "runnernet"
enable_ipv6: false
privileged: false
force_pull: true
force_rebuild: false
21 changes: 21 additions & 0 deletions docs/ci-riscv64.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# RISC-V CI Support

## Overview
This project supports RISC-V (riscv64) builds using cross-compilation
and QEMU emulation on x86_64 CI runners.

## Architecture
- Host: x86_64
- Toolchain: riscv64-linux-gnu
- Emulation: qemu-riscv64
- Execution: Docker container

## What this CI validates
- Successful RISC-V compilation
- Correct ELF architecture
- Runtime smoke test via QEMU

## What this CI does NOT do
- Performance benchmarking
- Native RISC-V validation

9 changes: 9 additions & 0 deletions event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"inputs": {
"x86_64_count": "0",
"riscv64_count": "1",
"aarch64_count": "0",
"win_x86_64_count": "0",
"osx_count": "0"
}
}