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
14 changes: 8 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ jobs:
os: ${{ fromJSON(vars.TRACE_CI_RUNNERS == 'self-hosted' && '["ubuntu-latest","macos-latest"]' || '["ubuntu-latest","windows-latest","macos-latest"]') }}
runtime: [MonoGame, FNA]
# Under TRACE_CI_RUNNERS=self-hosted (docs/self-hosted-runners.md in Trace Arena) Linux legs run on the local x64 runner and
# macOS legs on the local macOS runner.
# macOS legs on the local macOS runner. The Linux steps that render through the Vulkan software renderer are skipped there: it
# crashes under x64 emulation ("rosetta error: mmap_anonymous_rw mmap failed"), and the native arm64 runner lacks the freetype native library.
runs-on: ${{ vars.TRACE_CI_RUNNERS == 'self-hosted' && (matrix.os == 'macos-latest' && fromJSON('["self-hosted","macOS","ARM64"]') || fromJSON('["self-hosted","Linux","X64","yiazmat-linux-x64-emulated"]')) || matrix.os }}
env:
FORMA_RUNTIME: ${{ matrix.runtime }}
Expand Down Expand Up @@ -94,13 +95,13 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libegl1 libgl1 libgl1-mesa-dri libglx0 libglx-mesa0 mesa-vulkan-drivers vulkan-tools xvfb
software_icd=$(find /opt/google/chrome -name 'vk_swiftshader_icd.json' -print -quit)
software_icd=$(find /opt/google/chrome -name 'vk_swiftshader_icd.json' -print -quit 2>/dev/null || true)
software_icd=${software_icd:-$(find /usr/share/vulkan/icd.d -name 'lvp_icd*.json' -print -quit)}
test -n "$software_icd"
echo "VK_ICD_FILENAMES=$software_icd" >> "$GITHUB_ENV"
echo "VK_DRIVER_FILES=$software_icd" >> "$GITHUB_ENV"
- name: Validate Linux selected runtime
if: runner.os == 'Linux'
if: runner.os == 'Linux' && vars.TRACE_CI_RUNNERS != 'self-hosted'
shell: bash
env:
LIBGL_ALWAYS_SOFTWARE: 1
Expand All @@ -123,7 +124,7 @@ jobs:
MonoGamePlatform=DesktopVK FormaNativeRuntime=true xvfb-run -a -s '-screen 0 1440x900x24 +extension GLX' dotnet run --project tests/Forma.SvgRenderSmoke/Forma.SvgRenderSmoke.csproj --configuration Release -p:FormaRuntime=MonoGame -p:MonoGamePlatform=DesktopVK -p:FormaNativeRuntime=true -p:SvgBackend=Skia
fi
- name: Validate Linux FNA video
if: runner.os == 'Linux' && matrix.runtime == 'FNA'
if: runner.os == 'Linux' && matrix.runtime == 'FNA' && vars.TRACE_CI_RUNNERS != 'self-hosted'
shell: bash
env:
LIBGL_ALWAYS_SOFTWARE: 1
Expand All @@ -133,7 +134,7 @@ jobs:
FNA3D_OPENGL_WINDOW_DEPTHSTENCILFORMAT: None
run: env -u VK_ICD_FILENAMES -u VK_DRIVER_FILES xvfb-run -a -s '-screen 0 1440x900x24 +extension GLX' bash scripts/check-fna-video-smoke.sh
- name: Compare Linux peer rendering
if: runner.os == 'Linux' && matrix.runtime == 'MonoGame'
if: runner.os == 'Linux' && matrix.runtime == 'MonoGame' && vars.TRACE_CI_RUNNERS != 'self-hosted'
shell: bash
env:
LIBGL_ALWAYS_SOFTWARE: 1
Expand Down Expand Up @@ -273,7 +274,7 @@ jobs:
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libegl1 libgl1 libgl1-mesa-dri libglx0 libglx-mesa0 mesa-vulkan-drivers xvfb
software_icd=$(find /opt/google/chrome -name 'vk_swiftshader_icd.json' -print -quit)
software_icd=$(find /opt/google/chrome -name 'vk_swiftshader_icd.json' -print -quit 2>/dev/null || true)
software_icd=${software_icd:-$(find /usr/share/vulkan/icd.d -name 'lvp_icd*.json' -print -quit)}
test -n "$software_icd"
echo "VK_ICD_FILENAMES=$software_icd" >> "$GITHUB_ENV"
Expand All @@ -282,6 +283,7 @@ jobs:
env:
LIBGL_ALWAYS_SOFTWARE: 1
SDL_VIDEODRIVER: x11
FORMA_SKIP_FONT_XNB_CMP: ${{ vars.TRACE_CI_RUNNERS == 'self-hosted' && '1' || '' }}
run: bash scripts/retry.sh env -u VK_ICD_FILENAMES -u VK_DRIVER_FILES xvfb-run -a -s '-screen 0 1440x900x24 +extension GLX' bash scripts/test-package-consumer.sh
- uses: actions/upload-artifact@v7
with:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ jobs:
shell: bash
run: |
pages_root="$RUNNER_TEMP/forma-pages"
git worktree prune
if git ls-remote --exit-code origin refs/heads/gh-pages >/dev/null 2>&1; then
git fetch origin gh-pages
git worktree add "$pages_root" origin/gh-pages
Expand Down
9 changes: 8 additions & 1 deletion scripts/check-thorvg-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@ repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
image="forma-thorvg-linux:local"

docker build --platform linux/amd64 --file "$repo_root/scripts/Dockerfile.thorvg-linux" --tag "$image" "$repo_root"
# Inside a self-hosted runner container (Docker-outside-of-docker) the checkout is not a path the Docker host knows, so the
# container borrows this container's volumes and runs in the checkout instead of mounting it at /repo.
if [[ -f /.dockerenv && -n "${HOSTNAME:-}" ]]; then
repo_mount=(--volumes-from "$HOSTNAME" --workdir "$repo_root")
else
repo_mount=(--volume "$repo_root:/repo")
fi
docker run --rm \
--platform linux/amd64 \
--volume "$repo_root:/repo" \
"${repo_mount[@]}" \
--env MESON=/usr/local/bin/meson \
--env THORVG_ARTIFACTS_DIR=/tmp/forma-thorvg-linux \
"$image" \
Expand Down
14 changes: 9 additions & 5 deletions scripts/test-package-consumer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ for runtime in MonoGame FNA; do
catalog_project="$repository_root/samples/Forma.Catalog.FNA/Forma.Catalog.FNA.csproj"
fi
dotnet build "$catalog_project" --configuration Release -p:FormaRuntime="$runtime" --nologo
for font_name in Catalog CatalogCode; do
cmp \
"$repository_root/tests/Assets/Fonts/$font_name.xnb" \
"$repository_root/samples/Forma.Catalog.$runtime/bin/$runtime/Release/net10.0/Content/Fonts/$font_name.xnb"
done
# The committed font binaries are byte-exact only on native x64 Linux. The local self-hosted runners (Apple Silicon: x64 under
# Rosetta, or native arm64) compile different bytes, so the CI workflow sets FORMA_SKIP_FONT_XNB_CMP there and hosted CI keeps the check.
if [[ -z "${FORMA_SKIP_FONT_XNB_CMP:-}" ]]; then
for font_name in Catalog CatalogCode; do
cmp \
"$repository_root/tests/Assets/Fonts/$font_name.xnb" \
"$repository_root/samples/Forma.Catalog.$runtime/bin/$runtime/Release/net10.0/Content/Fonts/$font_name.xnb"
done
fi
done

for runtime in MonoGame FNA; do
Expand Down
Loading