-
Notifications
You must be signed in to change notification settings - Fork 4
66 lines (53 loc) · 2.22 KB
/
build.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
name: build
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
name: Build
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build Xamarin.iOS
run: msbuild /restore ./XamTrack.iOS/XamTrack.iOS.csproj /p:Platform=iPhoneSimulator /p:Configuration=Debug
- name: Build Xamarin.Android
run: msbuild /restore ./XamTrack.Android/XamTrack.Android.csproj /p:Configuration=Debug
test:
name: Run Tests
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- shell: bash
env:
DpsIdScope: ${{ secrets.DpsIdScope }},
IotHubConnectionString: ${{ secrets.IotHubConnectionString }},
DpsSymetricKey: ${{ secrets.DpsSymetricKey }},
SharedKey: ${{ secrets.SharedKey }}
run: |
#REMEMBER TO SETUP PIPELINE VARIABLE
if [ ! -n $DpsIdScope ]
then
echo "You need define the DpsIdScope variable in VSTS"
exit
fi
#PATH TO CONSTANTS FILE
APP_CONSTANT_FILE=../XamTrack.Core/appconfig.json
if [ -e "$APP_CONSTANT_FILE" ]
then
echo "Updating App Secret Values to DpsIdScope in appconfig.json"
sed -i '' 's#"DpsIdScope": "[a-z:./\\_]*"#"DpsIdScope": "$DpsIdScope"#' $APP_CONSTANT_FILE
echo "Updating App Secret Values to IotHubConnectionString in appconfig.json"
sed -i '' 's#"IotHubConnectionString": "[a-z:./\\_]*"#"IotHubConnectionString": "$IotHubConnectionString"#' $APP_CONSTANT_FILE
echo "Updating App Secret Values to DpsSymetricKey in appconfig.json"
sed -i '' 's#"DpsSymetricKey": "[a-z:./\\_]*"#"DpsSymetricKey": "$DpsSymetricKey"#' $APP_CONSTANT_FILE
echo "Updating App Secret Values to SharedKey in appconfig.json"
sed -i '' 's#"SharedKey": "[a-z:./\\_]*"#"SharedKey": "$SharedKey"#' $APP_CONSTANT_FILE
echo "File content:"
cat $APP_CONSTANT_FILE
fi
- name: Run Test
run: dotnet test ./XamTrack.Tests/XamTrack.Tests.csproj