-
Notifications
You must be signed in to change notification settings - Fork 3.2k
67 lines (55 loc) · 1.98 KB
/
core.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
name: Core Tests
on: [ push, pull_request ]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '--filter=') || contains(github.event.head_commit.message, '[core]')"
services:
tinyproxy:
image: "vimagick/tinyproxy"
ports:
- 8888:8888
socks5:
image: "xkuma/socks5"
ports:
- 1080:1080
env:
PROXY_USER: user
PROXY_PASSWORD: password
PROXY_SERVER: 0.0.0.0:1080
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: sudo apt update -y && sudo apt install -y googletest libgtest-dev redis-server libboost-stacktrace-dev libbrotli-dev
- name: configure
run: phpize && ./configure --enable-sockets --enable-mysqlnd --enable-openssl
- name: make
run: |
cmake . -D CODE_COVERAGE=ON -D enable_thread=1
make VERBOSE=1 -j $(nproc) lib-swoole
- name: make test with valgrind
if: "contains(github.event.head_commit.message, '--valgrind')"
run: |
sudo apt install -y valgrind
cd core-tests && SWOOLE_VALGRIND=1 ./run.sh
- name: make test with asan
if: "contains(github.event.head_commit.message, '--asan')"
run: |
cd core-tests && SWOOLE_ENABLE_ASAN=1 ./run.sh
- name: make test
run:
cd core-tests && ./run.sh
- name: run coverage
shell: bash
run: sudo apt-get install lcov &&
sudo lcov --directory . --capture --output-file coverage.info &&
sudo lcov --remove coverage.info "${{runner.workspace}}/swoole-src/include/*" '/usr/*' --output-file coverage.info &&
sudo lcov --list coverage.info
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.info
fail_ci_if_error: true