yavsc/.forgejo/workflows/buildAndTest.yml

70 lines
2 KiB
YAML
Raw Normal View History

2026-02-02 00:39:06 +00:00
# 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:
2026-08-18 21:25:06 +01:00
branches: [ "main", "release/*" ]
2026-02-02 00:39:06 +00:00
jobs:
build:
2026-08-16 13:03:17 +01:00
runs-on: docker
2026-02-02 00:39:06 +00:00
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
2026-08-26 01:42:59 +01:00
echo "✅ Checked out at $(git rev-parse HEAD) on $(git branch --show-current 2>/dev/null || echo detached HEAD)"
2026-08-25 23:07:19 +01:00
- name: Démarrer l'émulateur QEMU Headless
2026-08-25 23:01:00 +01:00
run: |
2026-08-26 00:20:17 +01:00
set -e
2026-08-26 02:24:03 +01:00
export ANDROID_AVD_HOME=${ANDROID_HOME}/.android/avd
2026-08-26 03:55:21 +01:00
adb start-server
echo "⌛ Démarrage de l'émulateur en tâche de fond..."
emulator -avd pixel_test \
-no-window \
-no-audio \
-no-boot-anim \
-gpu off &
2026-08-25 23:01:00 +01:00
EMU_PID=$!
2026-08-26 03:55:21 +01:00
2026-08-25 23:01:00 +01:00
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 !"
2026-02-02 00:39:06 +00:00
- name: Test
2026-08-25 23:06:25 +01:00
run: |
echo "⌛ Lancement des tests..."
2026-08-26 01:49:57 +01:00
cd /src/_src && dotnet test --verbosity normal && echo "✅ Success !"