This repository has been archived by the owner on Apr 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 112
76 lines (74 loc) · 3.44 KB
/
CI.yml
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
# This is a basic workflow to help you get started with Actions
name: CI-Mobile
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main, develop, 'feature/**', 'release/**' ]
paths:
- '.github/workflows/CI.yml'
- 'Covid19Radar/**'
- 'Covid19Radar.sln'
- 'Nuget.config'
pull_request:
branches: [ main, develop, 'feature/**', 'release/**' ]
paths:
- '.github/workflows/CI.yml'
- 'Covid19Radar/**'
- 'Covid19Radar.sln'
- 'Nuget.config'
jobs:
build_ios:
name: Build-iOS
runs-on: macos-11
strategy:
matrix:
Configuration: [Debug, Debug_Mock, Release]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Xamarin
uses: maxim-lobanov/setup-xamarin@v1
with:
mono-version: 6.12 # specify version in '<major>.<minor>' format
xamarin-ios-version: 15 # specify version in '<major>' format
xamarin-mac-version: latest # specify 'latest' keyword to pick up the latest available version
xamarin-android-version: 12 # specify full version; it is not recomended option because your pipeline can be broken suddenly in future
xcode-version: 13.0 # set the latest available Xcode 13.0
- name: Prepare settings.json
run: mv -f ${{ github.workspace }}/Covid19Radar/Covid19Radar/settings_template.json ${{ github.workspace }}/Covid19Radar/Covid19Radar/settings.json
- name: Workaround macos-latest(20220614.2) issue
run: rm ~/.config/NuGet/NuGet.Config
- name: Deploy nuget packages - ${{ matrix.Configuration }}
run: cp -Force ${{ github.workspace }}/TempNugetFeed/${{ matrix.Configuration }}/*.nupkg ${{ github.workspace }}/TempNugetFeed/ | true
- name: Build iOS Project - ${{ matrix.Configuration }}
run: msbuild ${{ github.workspace }}/Covid19Radar/Covid19Radar.iOS/Covid19Radar.iOS.csproj /restore /t:Build /p:Configuration=${{ matrix.Configuration }} /p:Platform=iPhoneSimulator
build_android:
name: Build-Android
runs-on: windows-latest
strategy:
matrix:
Configuration: [Debug, Debug_Mock, Release]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare settings.json
run: mv -Force ${{ github.workspace }}/Covid19Radar/Covid19Radar/settings_template.json ${{ github.workspace }}/Covid19Radar/Covid19Radar/settings.json
- name: Deploy nuget packages - ${{ matrix.Configuration }}
run: cp -Force ${{ github.workspace }}/TempNugetFeed/${{ matrix.Configuration }}/*.nupkg ${{ github.workspace }}/TempNugetFeed/| true
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Build Android Project - ${{ matrix.Configuration }}
run: msbuild ${{ github.workspace }}/Covid19Radar/Covid19Radar.Android/Covid19Radar.Android.csproj /restore /t:Build /p:Configuration=${{ matrix.Configuration }}
test:
name: Test
runs-on: macos-12 # Tests must be executed on macOs. If don't, tests will fail.
needs: [build_ios, build_android]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Prepare settings.json
run: mv -f ${{ github.workspace }}/Covid19Radar/Covid19Radar/settings_template.json ${{ github.workspace }}/Covid19Radar/Covid19Radar/settings.json
- name: Execute Unit Tests
run: dotnet test ${{ github.workspace }}/Covid19Radar/Tests/Covid19Radar.UnitTests/
env:
DOTNET_CLI_TELEMETRY_OPTOUT: true