-
-
Notifications
You must be signed in to change notification settings - Fork 56
50 lines (44 loc) · 1.15 KB
/
run-tests.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
name: Run tests
on:
push:
branches:
- main
- dev
paths:
- "fenjing/*"
- "tests/*"
- ".github/workflow/*"
workflow_dispatch:
permissions:
contents: read
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run tests
env:
VULUNSERVER_ADDR: "http://127.0.0.1:5000"
run: |
cd tests
export SLEEP_INTERVAL=0.01
# run these two tests first so it failed fast...
python vulunserver.py 2>/dev/null &
vulserver_pid=$!
python -m unittest test_payload_gen test_full_payload_gen
pip install coverage
coverage run --source ../fenjing -m unittest test_* && kill $vulserver_pid
coverage xml -i
# python -m unittest *.py
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}