-
Notifications
You must be signed in to change notification settings - Fork 79
179 lines (166 loc) · 5.67 KB
/
main.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
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
name: CI
on: [pull_request, workflow_dispatch, push]
env:
MODULE_PAK: pinpoint_php@${{ github.head_ref || github.ref_name }}
jobs:
cpp:
strategy:
matrix:
os: [ubuntu-latest, macos-13]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: actions-setup-cmake
uses: jwlawson/actions-setup-cmake@v1.6
with:
cmake-version: "3.16.x"
- name: Build agent
run: |
cd common
mkdir -p build
cd build
cmake -DWITH_TEST_CASE=1 -DWITH_CODECOVERAGE=1 -DCMAKE_BUILD_TYPE=Debug ..
make
./bin/TestCommon
- name: Codecovage
uses: codecov/codecov-action@v4
cpp-windows:
runs-on: [windows-latest]
steps:
- uses: actions/checkout@v2
- name: powershell allow...
shell: cmd
run: powershell -Command "Set-ExecutionPolicy RemoteSigned -Scope CurrentUser"
- name: Build agent
run: |
cd common
cmake --no-warn-unused-cli -DWITH_TEST_CASE=1 -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S. -B./build -G "Visual Studio 17 2022" -T host=x86 -A win32
cmake --build build --target ALL_BUILD --config debug --
./build/bin/Debug/TestCommon.exe
memory-leak:
needs: [cpp, cpp-windows]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: actions-setup-cmake
uses: jwlawson/actions-setup-cmake@v1.6
with:
cmake-version: "3.16.x"
- name: Build agent
run: |
sudo apt update || echo "update failed,but try to overlook it"
sudo apt install -y valgrind -y valgrind
cd common
mkdir -p build
cd build
cmake -DWITH_TEST_CASE=1 -DCMAKE_BUILD_TYPE=Debug ..
make
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
--log-file=valgrind-out.txt \
./bin/TestCommon
- name: Archive docs
uses: actions/upload-artifact@v3
with:
name: valgrind-out
path: common/build/valgrind-out.txt
PHP:
runs-on: ubuntu-latest
needs: cpp
strategy:
matrix:
php-version: ["7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3"]
steps:
- uses: actions/checkout@v2
with:
submodules: "true"
- name: update docker compose
run: |
wget "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64"
chmod +x docker-compose-linux-x86_64
./docker-compose-linux-x86_64 version
- name: start test environment
run: |
./docker-compose-linux-x86_64 -f "testapps/compose.yaml" build php-compatible --build-arg PHP_VERSION=${{ matrix.php-version }}
./docker-compose-linux-x86_64 -f "testapps/compose.yaml" up php-compatible
- name: Stop containers
# if: always()
run: ./docker-compose-linux-x86_64 -f "testapps/compose.yaml" down php-compatible
pack_php_module:
runs-on: ubuntu-latest
needs: PHP
steps:
- uses: actions/checkout@v2
- name: Package pinpoint_php
id: pack
run: |
tar -czf ${{ env.MODULE_PAK }} common/ src/PHP config.m4 tests LICENSE
md5=($(md5sum ${{ env.MODULE_PAK }} ))
PACK_NAME=${{ env.MODULE_PAK }}-${md5}-$(date '+%Y-%m-%d').tar.gz
mv ${{ env.MODULE_PAK }} $PACK_NAME
echo "PACK=$PACK_NAME" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: ${{ env.MODULE_PAK }}
path: ${{ steps.pack.outputs.PACK }}
Python:
strategy:
matrix:
os: [ubuntu-latest, macos-13]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: ${{ matrix.os }}
needs: [cpp, cpp-windows]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: run unittest
run: |
# ref https://github.com/pypa/setuptools/issues/3198
pip install -e .
python -m unittest discover -s src/PY/test
python-plugins:
# timeout-minutes: 20
needs: Python
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: "true"
- name: update docker compose
run: |
wget "https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64"
chmod +x docker-compose-linux-x86_64
./docker-compose-linux-x86_64 version
# run: docker-compose -f "testapps/compose.yaml" build python-plugins
# - name: build python-plugins
- name: start test environment
run: ./docker-compose-linux-x86_64 -f "testapps/compose.yaml" up python-plugins --exit-code-from python-plugins
- name: Stop containers
# if: always()
run: ./docker-compose-linux-x86_64 -f "testapps/compose.yaml" down python-plugins
Collector-agent:
strategy:
matrix:
go-version: [1.18.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: "true"
- name: Setup protoc
uses: arduino/setup-protoc@v2.1.0
- run: |
go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.28
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@v1.2
export PATH="$PATH:$(go env GOPATH)/bin"
cd collector-agent && make && go test ./... -v