-
Notifications
You must be signed in to change notification settings - Fork 9
100 lines (97 loc) · 2.99 KB
/
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
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
name: Tests
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: ['3.7', '3.8', '3.9']
os: ['ubuntu-latest']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
stable: false
python-version: ${{ matrix.python }}
- name: install dublin-traceroute
run: |
set -exu
sudo apt install -y libtins-dev libjsoncpp-dev libpcap-dev
git clone https://github.com/insomniacslk/dublin-traceroute.git
pushd dublin-traceroute
mkdir build
pushd build
cmake ..
make
sudo make install
popd
popd
- name: enter source directory
run: cd $GITHUB_WORKSPACE
- name: install dependencies
run: |
set -exu
sudo apt install -y graphviz libgraphviz-dev
pip install -r requirements.txt
- run: python setup.py build
- run: python setup.py install
- name: print help message
run: |
set -exu
cd /tmp # so it uses the installed module instead of the one in the source directory
python -m dublintraceroute --help
- name: plot
run: |
set -exu
cd /tmp
python -m dublintraceroute plot $GITHUB_WORKSPACE/.ci/bad.horse.json
- name: pretty print
run: |
set -exu
cd /tmp
python -c "import json; from dublintraceroute import TracerouteResults; TracerouteResults(json.load(open(\"$GITHUB_WORKSPACE/.ci/bad.horse.json\"))).pretty_print()"
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# pytest for python2 was dropped in Ubuntu 20.10, so cannot test it
# here.
python: ['3.7', '3.8', '3.9']
os: ['ubuntu-latest']
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
stable: false
python-version: ${{ matrix.python }}
- name: install dublin-traceroute
run: |
set -exu
sudo apt install -y libtins-dev libjsoncpp-dev libpcap-dev
git clone https://github.com/insomniacslk/dublin-traceroute.git
pushd dublin-traceroute
mkdir build
pushd build
cmake ..
make
sudo make install
popd
popd
- name: enter source directory
run: cd $GITHUB_WORKSPACE
- name: install dependencies
run: |
set -exu
sudo apt-add-repository ppa:ubuntu-toolchain-r/test
sudo apt install -y graphviz libgraphviz-dev
pip install -r requirements.txt
pip install -r testing_requirements.txt
- name: run unit tests
run: python setup.py test
- uses: codecov/[email protected]
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
flags: unittests
fail_ci_if_error: true
verbose: true