-
Notifications
You must be signed in to change notification settings - Fork 1
91 lines (78 loc) · 3.49 KB
/
Copy pathci.yml
File metadata and controls
91 lines (78 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: CI
# Run unit tests on every pull request, regardless of which branch it targets,
# so incoming PRs are verified before merge. Also runnable manually.
on:
pull_request:
workflow_dispatch:
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up .NET (from global.json)
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
# Each test project (TUnit on Microsoft.Testing.Platform) is an executable
# that returns a non-zero exit code on failure. They reference only the
# plain net10.0 libraries (Core / UI / Data) — not the MAUI Android head —
# so no Android SDK or maui workload is needed here. Release config means
# TreatWarningsAsErrors also gates the build.
- name: Core tests
run: dotnet run --project tests/SharpClient.Tests/SharpClient.Tests.csproj -c Release
- name: UI component tests (bUnit)
run: dotnet run --project tests/SharpClient.UI.Tests/SharpClient.UI.Tests.csproj -c Release
- name: Data / persistence tests
run: dotnet run --project tests/SharpClient.Data.Tests/SharpClient.Data.Tests.csproj -c Release
android-build:
name: Android head build
runs-on: ubuntu-latest
# Compile the MAUI Android head (src/SharpClient.App) for net10.0-android on
# every PR so Android-only regressions (manifest, platform services,
# TNC-on-Android, etc.) are caught before merge. This job needs JDK 17 + the
# Android SDK + the maui-android workload, unlike the plain net10.0 test job.
steps:
- name: Checkout
uses: actions/checkout@v4
# .NET for Android (net10.0-android) requires JDK 17 specifically.
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
- name: Set up .NET (from global.json)
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
# Restore the workload pinned by the repo (maui-android). Using
# `workload restore` keeps versions consistent with the project's
# workload manifest rather than pulling whatever `install` resolves.
- name: Install MAUI Android workload
run: dotnet workload restore src/SharpClient.App/SharpClient.App.csproj
# Acquire any missing Android SDK platform/build-tools for the target API
# into the runner's pre-installed SDK (ANDROID_SDK_ROOT) and accept licenses,
# so the subsequent build does not fail on a missing SDK component.
- name: Install Android SDK dependencies
run: >
dotnet build src/SharpClient.App/SharpClient.App.csproj
-f net10.0-android
-t:InstallAndroidDependencies
-p:AcceptAndroidSdkLicenses=True
-p:JavaSdkDirectory="$JAVA_HOME"
-p:AndroidSdkDirectory="$ANDROID_SDK_ROOT"
# Release config also gates the build via TreatWarningsAsErrors. This only
# compiles the app (no signing / packaging) — release packaging lives in
# release-apk.yml.
- name: Build Android head (Release)
run: >
dotnet build src/SharpClient.App/SharpClient.App.csproj
-c Release
-f net10.0-android
-p:JavaSdkDirectory="$JAVA_HOME"
-p:AndroidSdkDirectory="$ANDROID_SDK_ROOT"
-p:AcceptAndroidSdkLicenses=True