-
Notifications
You must be signed in to change notification settings - Fork 3
90 lines (79 loc) · 2.35 KB
/
unit-test.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Run YDBCP tests
on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
jobs:
unittest:
runs-on: ubuntu-latest
outputs:
job-summary: ${{ steps.job-summary.outputs.job-summary }}
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Cache go modules
uses: magnetikonline/action-golang-cache@v5
with:
go-version-file: go.mod
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: Install proto plugins
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
- name: Compile protos
run: make proto
- name: Build
run: |
go mod tidy
go build -v ./...
- name: Test
uses: robherley/[email protected]
with:
testArguments: './... -race --timeout=10s'
- name: Generate summary
uses: austenstone/[email protected]
id: job-summary
with:
create-pdf: false
integration-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: supply with s3 access keys
run: |
echo "ydbcp" > access_key
echo "password" > secret_key
- name: docker compose up
run: |
docker compose up --build -d
- name: run make_backup tests
run: |
while [ "$(docker inspect -f {{.State.Health.Status}} local-ydbcp)" != "healthy" ]; do
echo "Waiting for container to become healthy..."
sleep 1
done
echo "Starting tests!"
docker exec local-ydbcp sh -c './make_backup'
- name: docker compose down
run: |
docker compose down
- name: docker compose up
run: |
docker compose up -d
- name: run list_entities test
run: docker exec local-ydbcp sh -c './list_entities'
- name: docker compose down
run: |
docker compose down
- name: docker compose up
run: |
docker compose up -d
- name: run orm test
run: docker exec local-ydbcp sh -c './orm'
- name: docker compose down
run: |
docker compose down