mirror of
https://github.com/stride3d/stride.git
synced 2026-10-12 02:23:23 +00:00
The called workflows fell back to github.ref, shared by every master push, so each push cancelled the previous commit's jobs and Gate reported them as failures. PRs still group by PR number.
94 lines
3.3 KiB
YAML
94 lines
3.3 KiB
YAML
name: Test Linux (Simple)
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
build-type:
|
|
description: Build Configuration
|
|
default: Debug
|
|
type: choice
|
|
options:
|
|
- Debug
|
|
- Release
|
|
test-filter:
|
|
description: 'dotnet test --filter expression (blank = all tests)'
|
|
type: string
|
|
default: ''
|
|
repeat:
|
|
description: 'Rerun the filtered test set up to N times, stop on first failure (flake hunting). 1 = single run (default).'
|
|
type: number
|
|
default: 1
|
|
workflow_call:
|
|
inputs:
|
|
build-type:
|
|
default: Debug
|
|
type: string
|
|
test-filter:
|
|
default: ''
|
|
type: string
|
|
repeat:
|
|
default: 1
|
|
type: number
|
|
|
|
concurrency:
|
|
group: test-linux-simple-${{ github.event.pull_request.number || github.sha }}-${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
Linux-Tests:
|
|
name: Linux (Simple, ${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }})
|
|
runs-on: ubuntu-24.04
|
|
timeout-minutes: 20
|
|
steps:
|
|
# Full checkout: the Simple test solutions build Stride.Templates.*, which
|
|
# preprocesses template content from samples/.
|
|
- uses: actions/checkout@v7
|
|
with:
|
|
lfs: true
|
|
submodules: true
|
|
ref: ${{ github.ref }}
|
|
- name: Install dependencies
|
|
# Vulkan loader for Stride.Shaders.Tests (renders through the bundled Lavapipe ICD); lld links the native
|
|
# crash trigger (Stride.CrashReport, pulled in by Stride.CrashReport.Tests)
|
|
run: sudo apt-get update && sudo apt-get install -y libvulkan1 lld
|
|
- name: Build
|
|
run: |
|
|
dotnet build build/Stride.Tests.Simple.Linux.slnf \
|
|
-p:StrideTestRuntimeIdentifier=linux-x64 \
|
|
-nr:false \
|
|
-v:m -p:WarningLevel=0 \
|
|
-p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} \
|
|
-p:StridePlatforms=Linux \
|
|
-p:StrideGraphicsApis=Vulkan
|
|
- name: Test
|
|
run: |
|
|
FILTER="${{ github.event.inputs.test-filter || inputs.test-filter }}"
|
|
REPEAT="${{ github.event.inputs.repeat || inputs.repeat || '1' }}"
|
|
FILTER_ARG=()
|
|
if [ -n "$FILTER" ]; then FILTER_ARG=(--filter "$FILTER"); fi
|
|
for i in $(seq 1 "$REPEAT"); do
|
|
echo "=== Test run $i / $REPEAT ==="
|
|
dotnet test build/Stride.Tests.Simple.Linux.slnf \
|
|
--no-build \
|
|
--logger:"trx;LogFilePrefix=run-$i" --results-directory TestResults \
|
|
--blame-hang-timeout 5m --blame-hang-dump-type full \
|
|
-p:Configuration=${{ github.event.inputs.build-type || inputs.build-type || 'Debug' }} \
|
|
"${FILTER_ARG[@]}" || { ec=$?; echo "Run $i failed (exit $ec); stopping."; exit $ec; }
|
|
done
|
|
- name: Publish Test Report
|
|
if: always()
|
|
uses: phoenix-actions/test-reporting@v16
|
|
with:
|
|
name: 'Test Report: Linux Simple'
|
|
path: TestResults/*.trx
|
|
reporter: dotnet-trx
|
|
output-to: step-summary
|
|
list-tests: 'failed'
|
|
- name: Upload test results
|
|
if: always()
|
|
uses: actions/upload-artifact@v7
|
|
with:
|
|
name: test-results-linux-simple
|
|
path: TestResults/
|
|
if-no-files-found: ignore
|