-
Notifications
You must be signed in to change notification settings - Fork 7
161 lines (131 loc) · 5.01 KB
/
build.yaml
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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
BUILD_TYPE: ["Debug"]
os: [ windows-latest ]
steps:
- uses: actions/checkout@v4
- name: Get MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Get specific version CMake, v3.21.2
uses: lukka/[email protected]
- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.79.0
components: rustfmt, clippy
- name: Run cargo check
run: cargo check
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy
run: cargo clippy -- -D warnings
- name: run cmake
run: >
cmake . -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -B build
- name: run build
run: cmake --build build --config ${{ matrix.BUILD_TYPE }}
# mysql bin has conflicting dlls with fabric than prevents fabric from starting
- name: Remove conflict dll paths
shell: powershell
run: |
get-command libprotobuf.dll | format-list
Remove-Item -Recurse -Force "C:\Program Files\MySQL\MySQL Server 8.0\bin"
- name: check sf exist
run: Powershell.exe -File .\scripts\check_sf_installed.ps1
# Creates a 5 node dev cluster
- name: start sf cluster
run: Powershell.exe -File "C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\DevClusterSetup.ps1"
- name: start connection
run: Powershell.exe -File .\scripts\check_cluster_online.ps1
- name: provision apps and run tests
shell: powershell
run: |
# The test will add and remove app
.\tests\echo_script_test.ps1
.\scripts\echomain_stateful_ctl2.ps1 -Action Add
.\scripts\echomain_ctl.ps1 -Action Add
- name: Run cargo test
run: cargo test --all -- --nocapture
build-linux:
runs-on: ${{ matrix.os }}
strategy:
matrix:
BUILD_TYPE: ["Debug"]
os: [ ubuntu-20.04 ]
steps:
- uses: actions/checkout@v4
- name: apt-get
run: sudo apt-get update && sudo apt-get install apt-transport-https curl lsb-release wget gnupg2 software-properties-common debconf-utils clang lld -y
- name: install sf
run: |
wget -q https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb;
sudo dpkg -i packages-microsoft-prod.deb;
curl -fsSL https://packages.microsoft.com/keys/msopentech.asc | sudo apt-key add - ;
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - ;
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" ;
sudo apt-get update;
echo "servicefabric servicefabric/accepted-eula-ga select true" | sudo debconf-set-selections ;
echo "servicefabricsdkcommon servicefabricsdkcommon/accepted-eula-ga select true" | sudo debconf-set-selections ;
sudo apt-get install servicefabricsdkcommon -y;
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/microsoft/servicefabric/bin/Fabric/Fabric.Code" >> $GITHUB_ENV
- name: Get specific version CMake, v3.21.2
uses: lukka/[email protected]
- name: Install rust stable
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.79.0
components: rustfmt, clippy
- name: Run cargo check
run: cargo check
- name: Run cargo fmt
run: cargo fmt --all -- --check
- name: Run cargo clippy
run: cargo clippy -- -D warnings
- name: run cmake
run: >
cmake . -DCMAKE_BUILD_TYPE=${{ matrix.BUILD_TYPE }} -B build
- name: run build
run: cmake --build build --config ${{ matrix.BUILD_TYPE }}
- name: install sfctl
run: |
pip3 install -I sfctl==11.1.0
echo "~/.local/bin" >> $GITHUB_PATH
- name: test sfctl
run: sfctl --version
- name: start sf
run: sudo /opt/microsoft/sdk/servicefabric/common/clustersetup/devclustersetup.sh
- name: test cluster health
run: |
set +e # do not exit on error
counter=0
COMMAND_STATUS=1
until [ $COMMAND_STATUS -eq 0 ]; do
echo "attempt #${counter}"
sfctl cluster select
COMMAND_STATUS=$?
sleep 1
let counter=counter+1
if [[ $counter -eq 10 ]] ;
then
echo "Retry max reached" && exit 1
fi
done
sfctl cluster health
- name: run echo app
run: |
sleep 120 # wait for cluster to be up
sfctl application upload --path build/echoapp_root
sfctl application provision --application-type-build-path echoapp_root
sfctl application create --app-name fabric:/EchoApp --app-type EchoApp --app-version 0.0.1
# TODO: this fails in CI
# - name: resolve service
# run: |
# sleep 120 # wait for app to be up
# sfctl service resolve --service-id EchoApp/EchoAppService
- name: Run cargo test
run: cargo test --all -- --nocapture