Skip to content

Commit 09adcbc

Browse files
Jake-DerrickJake-Derrick
authored andcommitted
split ios and android CI
1 parent a3b86a3 commit 09adcbc

File tree

1 file changed

+70
-4
lines changed

1 file changed

+70
-4
lines changed

.github/workflows/ci.yml

Lines changed: 70 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,86 @@ on:
88
pull_request:
99
branches: [ "main" ]
1010

11+
env:
12+
DOTNET_VERSION: 10.0.x
13+
1114
jobs:
12-
build:
15+
android:
16+
name: Android build
1317
runs-on: ubuntu-latest
14-
1518
steps:
1619
- uses: actions/checkout@v4
1720

1821
- name: Setup .NET
1922
uses: actions/setup-dotnet@v4
2023
with:
21-
dotnet-version: 10.0.x
24+
dotnet-version: ${{ env.DOTNET_VERSION }}
25+
26+
- name: Cache NuGet packages
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.nuget/packages
30+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj','**/global.json') }}
31+
restore-keys: ${{ runner.os }}-nuget-
32+
33+
- name: Cache dotnet workload packs
34+
uses: actions/cache@v4
35+
with:
36+
path: |
37+
~/.dotnet/packs
38+
~/.dotnet/workloads
39+
key: ${{ runner.os }}-dotnet-workloads-${{ env.DOTNET_VERSION }}-${{ hashFiles('**/*.csproj','**/global.json') }}
40+
restore-keys: ${{ runner.os }}-dotnet-workloads-${{ env.DOTNET_VERSION }}-
41+
42+
- name: Install .NET MAUI Android workload
43+
run: |
44+
dotnet workload restore
45+
dotnet workload install maui-android --skip-manifest-update
46+
47+
- name: Install OpenJDK (Android builds may require Java)
48+
run: sudo apt-get update && sudo apt-get install -y openjdk-11-jdk
2249

2350
- name: Restore dependencies
2451
run: dotnet restore src/Plugin.Maui.OtpReader/Plugin.Maui.OtpReader.csproj
2552

26-
- name: Build
53+
- name: Build (Android)
2754
run: dotnet build src/Plugin.Maui.OtpReader/Plugin.Maui.OtpReader.csproj --no-restore -c Release
55+
56+
ios:
57+
name: iOS build
58+
runs-on: macos-latest
59+
needs: android
60+
steps:
61+
- uses: actions/checkout@v4
62+
63+
- name: Setup .NET
64+
uses: actions/setup-dotnet@v4
65+
with:
66+
dotnet-version: ${{ env.DOTNET_VERSION }}
67+
68+
- name: Cache NuGet packages
69+
uses: actions/cache@v4
70+
with:
71+
path: ~/.nuget/packages
72+
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj','**/global.json') }}
73+
restore-keys: ${{ runner.os }}-nuget-
74+
75+
- name: Cache dotnet workload packs
76+
uses: actions/cache@v4
77+
with:
78+
path: |
79+
~/.dotnet/packs
80+
~/.dotnet/workloads
81+
key: ${{ runner.os }}-dotnet-workloads-${{ env.DOTNET_VERSION }}-${{ hashFiles('**/*.csproj','**/global.json') }}
82+
restore-keys: ${{ runner.os }}-dotnet-workloads-${{ env.DOTNET_VERSION }}-
83+
84+
- name: Install .NET MAUI iOS workload
85+
run: |
86+
dotnet workload restore
87+
dotnet workload install maui-ios --skip-manifest-update
88+
89+
- name: Restore dependencies
90+
run: dotnet restore src/Plugin.Maui.OtpReader/Plugin.Maui.OtpReader.csproj
91+
92+
- name: Build (iOS)
93+
run: dotnet build src/Plugin.Maui.OtpReader/Plugin.Maui.OtpReader.csproj --no-restore -c Release

0 commit comments

Comments
 (0)