-
Notifications
You must be signed in to change notification settings - Fork 18
93 lines (87 loc) · 3.14 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
# This is a basic workflow to help you get started with Actions
name: cpp2sky test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
format:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup clang-format
run: |
git clone https://github.com/Sarcasm/run-clang-format.git
- name: Run clang-format
run: find ./ -iname "*.h" -o -iname "*.cc" | xargs ./run-clang-format/run-clang-format.py
test:
runs-on: ubuntu-20.04
steps:
- run: |
echo "/opt/llvm/bin" >> $GITHUB_PATH
- uses: actions/checkout@v3
- name: Run bazel test with GCC c++11
run: |
bazel test --cxxopt=-std=c++0x //...
- name: Run bazel test with GCC c++17
run: |
bazel test --cxxopt=-std=c++17 //...
- name: Run bazel test with CLANG c++11
run: |
bazel test --config=clang --cxxopt=-std=c++0x //...
- name: Run bazel test with CLANG c++17
run: |
bazel test --config=clang --cxxopt=-std=c++17 //...
- name: Install cmake dependencies and run cmake compile
run: |
sudo apt update
sudo apt -y install cmake
sudo git clone -b v9.1.0 https://github.com/apache/skywalking-data-collect-protocol.git ./3rdparty/skywalking-data-collect-protocol
sudo git clone -b v1.46.6 https://github.com/grpc/grpc.git --recursive
sudo cmake -S ./grpc -B ./grpc/build
sudo cmake --build ./grpc/build --parallel 8 --target install
sudo cmake -S . -B ./build
sudo cmake --build ./build
- name: Install lcov and genhtml and link llvm
run: |
sudo apt update
sudo apt -y install lcov
sudo ln -s /usr/bin/llvm-profdata-11 /usr/bin/llvm-profdata
sudo ln -s /usr/bin/llvm-cov-11 /usr/bin/llvm-cov
- name: Run coverage test
run: |
./coverage.sh
- name: upload coverage data to codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
files: ./coverage_report/coverage.dat
name: codecov-cpp2sky
verbose: true
e2e-cpp:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Prepare service container
run: |
docker compose -f test/e2e/docker/docker-compose.e2e.yml up -d
- name: Run e2e
run: |
pip3 install --upgrade pip
pip3 install setuptools
pip3 install -r test/e2e/requirements.txt
python3 test/e2e/main.py --expected_file=test/e2e/data/expected.yaml --max_retry_times=3 --target_path=/ping
e2e-python:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Prepare service container
run: |
docker compose -f test/e2e/docker/docker-compose.e2e-python.yml up -d
- name: Run e2e
run: |
pip3 install --upgrade pip
pip3 install setuptools
pip3 install -r test/e2e/requirements.txt
python3 test/e2e/main.py --expected_file=test/e2e/data/expected-python.yaml --max_retry_times=3 --target_path=/ping2