Some checks failed
Dotnet build and test / build (pull_request) Failing after 10m18s
69 lines
2.2 KiB
YAML
69 lines
2.2 KiB
YAML
# This workflow will build a .NET project
|
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
|
|
name: Dotnet build and test
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
logLevel:
|
|
description: 'Log level'
|
|
required: true
|
|
default: 'warning'
|
|
type: choice
|
|
options:
|
|
- info
|
|
- warning
|
|
- debug
|
|
tags:
|
|
description: 'Test scenario tags'
|
|
required: false
|
|
type: boolean
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main", "release/*" ]
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: docker
|
|
container:
|
|
# Options cruciales pour donner accès à KVM et autoriser l'émulation
|
|
options: --device /dev/kvm --privileged
|
|
|
|
steps:
|
|
- name: Clone yavsc
|
|
run: |
|
|
cd /src
|
|
git clone https://forgejo.pschneider.fr/notazof/yavsc.git _src
|
|
cd _src
|
|
if [ -n "${GITHUB_REF:-}" ]; then
|
|
git fetch origin "$GITHUB_REF"
|
|
git checkout FETCH_HEAD
|
|
fi
|
|
git submodule update --init --recursive
|
|
echo "Checked out at $(git rev-parse HEAD) on $(git branch --show-current 2>/dev/null || echo detached HEAD)"
|
|
- name: Restore dependencies
|
|
run: cd /src/_src && dotnet restore
|
|
- name: Build
|
|
run: cd /src/_src && dotnet build --no-restore
|
|
- name: Démarrer l'émulateur QEMU Headless
|
|
run: |
|
|
echo "Démarrage de l'émulateur en tâche de fond..."
|
|
# Remplacer 'pixel_5_api_30' par le nom exact de votre AVD créé sur l'hôte
|
|
emulator -avd emulator-5554 -no-window -no-audio -no-boot-anim -gpu swiftshader &
|
|
EMU_PID=$!
|
|
echo "Attente de la détection par ADB..."
|
|
adb wait-for-device
|
|
echo "Attente de la fin du boot d'Android..."
|
|
OUT=""
|
|
while [[ "$OUT" != "1" ]]; do
|
|
sleep 5
|
|
OUT=$(adb shell getprop sys.boot_completed | tr -d '\r')
|
|
echo "Statut actuel : ${OUT:-0}"
|
|
done
|
|
echo "✅ L'émulateur Android est prêt !"
|
|
- name: Test
|
|
run: |
|
|
echo "⌛ Lancement des tests..."
|
|
cd /src/_src && dotnet test --no-build --verbosity normal
|