File tree 1 file changed +42
-29
lines changed
1 file changed +42
-29
lines changed Original file line number Diff line number Diff line change 1
1
name : Python Coverage
2
-
3
- on : [push, pull_request]
4
-
2
+ on :
3
+ push :
4
+ pull_request :
5
+ workflow_dispatch :
5
6
jobs :
6
7
build :
7
-
8
8
runs-on : ubuntu-latest
9
-
9
+ timeout-minutes : 3
10
+
10
11
steps :
11
- - name : Check out code
12
- uses : actions/checkout@v2
13
-
14
- - name : Set up Python
15
- uses : actions/setup-python@v2
16
- with :
17
- python-version : ' 3.x'
18
-
19
- - name : Install dependencies
20
- run : |
21
- python -m pip install --upgrade pip
22
- pip install -r requirements.txt
23
-
24
- - name : Run coverage
25
- run : |
26
- coverage run -m unittest discover
27
- coverage html
28
-
29
- - run : smokeshow upload htmlcov
30
- env :
31
- SMOKESHOW_GITHUB_STATUS_DESCRIPTION : CLI Coverage {coverage-percentage}
32
- SMOKESHOW_GITHUB_COVERAGE_THRESHOLD : 50
33
- SMOKESHOW_GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
- SMOKESHOW_GITHUB_PR_HEAD_SHA : ${{ github.event.pull_request.head.sha }}
12
+ - name : Check out code
13
+ uses : actions/checkout@v4
14
+
15
+ - name : Set up Python
16
+ uses : actions/setup-python@v4
17
+ with :
18
+ python-version : ' 3.x'
19
+
20
+ - name : Run database server in docker
21
+ run : |
22
+ docker compose create
23
+ docker compose start
24
+ echo "wait mysql server"
25
+
26
+ while :
27
+ do
28
+ if mysql -h 127.0.0.1 --user=root --execute "SELECT version();" 2>&1 >/dev/null && mysql -h 127.0.0.1 --port=3307 --user=root --execute "SELECT version();" 2>&1 >/dev/null; then
29
+ break
30
+ fi
31
+ sleep 1
32
+ done
33
+
34
+ - name : Install dependencies
35
+ run : |
36
+ python -m pip install --upgrade pip
37
+ pip install .
38
+ pip install pytest coverage smokeshow
39
+
40
+ - name : Run coverage
41
+ run : |
42
+ coverage run -m pytest -k "not test_no_trailing_rotate_event and not test_end_log_pos and not test_query_event_latin1"
43
+ coverage html
44
+
45
+ - run : smokeshow upload htmlcov
46
+ env :
47
+ SMOKESHOW_GITHUB_COVERAGE_THRESHOLD : 60
You can’t perform that action at this time.
0 commit comments