-
Notifications
You must be signed in to change notification settings - Fork 527
96 lines (80 loc) · 2.77 KB
/
backend-e2e-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
91
92
93
94
95
96
name: Backend E2E Test
on:
push:
branches:
- master
paths:
- 'api/**'
pull_request:
branches:
- master
paths:
- 'api/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/master' && github.run_number || github.ref }}
cancel-in-progress: true
jobs:
backend-e2e-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: setup go
uses: actions/setup-go@v3
with:
go-version: "1.19"
- uses: docker/setup-buildx-action@v2
- uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-apisixdashboard-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-apisixdashboard-
${{ runner.os }}-buildx-
- name: Modify conf.yaml Configure for use by the manage-api cluster
run: |
sed -i 's/127.0.0.1:2379/etcd:2379/' ./api/conf/conf.yaml
sed -i '[email protected]@0.0.0.0/0@' ./api/conf/conf.yaml
sed -i '[email protected]/0:[email protected]:9000@' ./api/conf/conf.yaml
sed -i 's/enabled: false/enabled: true/' ./api/conf/conf.yaml
- name: build docker images
working-directory: ./api/test/docker
continue-on-error: true
run: |
docker buildx bake --load \
-f docker-compose.yaml \
--set *.cache-from=type=local,src=/tmp/.buildx-cache \
--set *.cache-to=type=local,dest=/tmp/.buildx-cache
- name: build and start grpc_server_example
working-directory: ./api/test/docker
run: |
wget https://github.com/api7/grpc_server_example/archive/refs/tags/20210819.tar.gz
tar -xzvf 20210819.tar.gz && cd grpc_server_example-20210819
docker build -t grpc_server_example:latest .
- name: run docker compose
working-directory: ./api/test/docker
run: |
docker-compose up -d
sleep 5
docker logs docker_managerapi_1
- name: install ginkgo cli
run: go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo@latest
- name: run test
working-directory: ./api/test/e2e
run: |
go mod download
ginkgo -r --flake-attempts=3 -v
- name: stop docker compose
working-directory: ./api/test/docker
run: |
docker-compose down
sleep 10
- name: output test coverage
working-directory: ./api/test/testdata
run: |
go tool cover -func=./integrationcover.out
- name: upload coverage profile
working-directory: ./api/test/testdata
run: |
bash <(curl -s https://codecov.io/bash) -f ./integrationcover.out -F backend-e2e-test-ginkgo