forked from cloudwego/kitex
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (84 loc) · 2.47 KB
/
tests.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: Tests
on: [ push, pull_request ]
jobs:
unit-scenario-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.17'
- name: Unit Test
run: go test -gcflags=-l -race -covermode=atomic -coverprofile=coverage.txt ./...
- name: Scenario Tests
run: |
cd ..
rm -rf kitex-tests
git clone https://github.com/cloudwego/kitex-tests.git
cd kitex-tests
./run.sh ${{github.workspace}}
cd ${{github.workspace}}
- name: Codecov
run: bash <(curl -s https://codecov.io/bash)
benchmark-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.17'
- name: Benchmark
run: go test -gcflags='all=-N -l' -bench=. -benchmem -run=none ./...
compatibility-test:
strategy:
matrix:
go: [ 1.17, 1.18, 1.19.12, 1.20.7, 1.21, 1.22 ]
os: [ X64, ARM64 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Unit Test
run: go test -gcflags=-l -race -covermode=atomic ./...
codegen-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: '1.17'
- name: Prepare
run: |
go install github.com/cloudwego/thriftgo@main
go install ./tool/cmd/kitex
LOCAL_REPO=$(pwd)
cd ..
git clone https://github.com/cloudwego/kitex-tests.git
cd kitex-tests/codegen
go mod init codegen-test
go mod edit -replace=github.com/apache/thrift=github.com/apache/[email protected]
go mod edit -replace github.com/cloudwego/kitex=${LOCAL_REPO}
go mod tidy
bash -version
bash ./codegen_install_check.sh
- name: CodeGen
run: |
cd ../kitex-tests/codegen
tree
bash ./codegen_run.sh
windows-test:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: "1.20"
- name: Windows compatibility test
run: go test -run=^$ ./...