-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (91 loc) · 3.16 KB
/
test.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
name: test
on:
push:
pull_request:
jobs:
# First, check if the types/formatting is correct.
types:
# TODO: Later we can add more python versions but for now one should be enough.
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.11
architecture: x64
- name: Install repo dependencies
run: pip install -r requirements.txt
- name: Install mypy
run: pip install mypy
- name: Run mypy check
run: mypy nfvsmotifs
# Then do a "small" test run with code coverage.
coverage:
runs-on: ubuntu-latest
timeout-minutes: 30
needs: types
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install clingo
run: sudo apt-get -y install gringo
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.11
architecture: x64
- name: Fetch and install native Pint
run: |
wget https://github.com/pauleve/pint/releases/download//2019-05-24/pint_2019-05-24_amd64.deb
sudo apt install ./pint_2019-05-24_amd64.deb
- name: Fetch and install Mole
run: |
wget http://www.lsv.fr/~schwoon/tools/mole/mole-140428.tar.gz
tar -xvf mole-140428.tar.gz
(cd ./mole-140428 && make)
(cd ./mole-140428 && pwd >> $GITHUB_PATH)
- name: Install repo dependencies
run: pip install -r requirements.txt
- name: Install pytest
run: pip install pytest pytest-cov
- name: Run pytest with coverage
run: python3 -m pytest --networksize 20 --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=nfvsmotifs tests/ | tee pytest-coverage.txt
- name: Pytest coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
# Then do a full test for correctness using larger networks.
tests:
runs-on: ubuntu-latest
timeout-minutes: 60
needs: [types, coverage]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install clingo
run: sudo apt-get -y install gringo
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.11
architecture: x64
- name: Fetch and install native Pint
run: |
wget https://github.com/pauleve/pint/releases/download//2019-05-24/pint_2019-05-24_amd64.deb
sudo apt install ./pint_2019-05-24_amd64.deb
- name: Fetch and install Mole
run: |
wget http://www.lsv.fr/~schwoon/tools/mole/mole-140428.tar.gz
tar -xvf mole-140428.tar.gz
(cd ./mole-140428 && make)
(cd ./mole-140428 && pwd >> $GITHUB_PATH)
- name: Install repo dependencies
run: pip install -r requirements.txt
- name: Install pytest
run: pip install pytest
- name: Run pytest (without coverage)
run: python3 -m pytest --networksize 50 tests/