-
Notifications
You must be signed in to change notification settings - Fork 27
70 lines (66 loc) · 2.28 KB
/
build_and_it.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
name: Build_And_GRPC_IntegrationTests
on:
push:
branches: [dev, main, "feat/**"]
pull_request:
branches: [dev, main]
jobs:
linux:
name: build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
services:
redis6379:
image: redis
ports:
- 6379:6379
mysql:
image: "mysql:8.0"
ports:
- 3306:3306
options: >-
--health-cmd="mysqladmin ping"
--health-interval=10s
--health-timeout=5s
--health-retries=3
-e MYSQL_ROOT_PASSWORD=123456
--entrypoint sh mysql:8.0 -c "exec docker-entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password"
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v3
- name: Setup .NET SDK 7.0.x
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Show dotnet Version
run: |
dotnet --list-sdks
dotnet --list-runtimes
- name: Create database
run: |
mysql -h127.0.0.1 -uroot -p123456 < /home/runner/work/client-csharp/client-csharp/sqls/barrier.mysql.sql
mysql -h127.0.0.1 -uroot -p123456 < /home/runner/work/client-csharp/client-csharp/sqls/busi.mysql.sql
- name: Setup DTM server
run: |
wget https://github.com/dtm-labs/dtm/releases/download/v1.17.1/dtm_1.17.1_linux_amd64.tar.gz
tar -xvf dtm_1.17.1_linux_amd64.tar.gz
pwd
mkdir /home/runner/work/client-csharp/client-csharp/logs
nohup ./dtm > /home/runner/work/client-csharp/client-csharp/logs/dtm.log 2>&1 &
sleep 5
curl "127.0.0.1:36789/api/dtmsvr/newGid"
- name: Setup Busi Service
run: |
cd tests/BusiGrpcService
nohup dotnet run > /home/runner/work/client-csharp/client-csharp/logs/app.log 2>&1 &
- name: Run Integration Tests
run: |
dotnet build tests/Dtmgrpc.IntegrationTests/Dtmgrpc.IntegrationTests.csproj
dotnet test tests/Dtmgrpc.IntegrationTests/Dtmgrpc.IntegrationTests.csproj
- name: Upload logs
if: always()
uses: actions/upload-artifact@v3
with:
name: dtm-logs
path: /home/runner/work/client-csharp/client-csharp/logs