-
Notifications
You must be signed in to change notification settings - Fork 3
94 lines (72 loc) · 2.6 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
93
94
name: CI
on: [push]
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt install -y libpcap-dev libtss2-dev
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: syphar/restore-virtualenv@v1
id: cache-virtualenv
# looks for changes in requirements.txt
with:
requirement_files: requirements.txt
- uses: syphar/restore-pip-download-cache@v1
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
# the package installation will only be executed when the
# requirements-files have changed.
- run: pip install --upgrade pip && pip install . && pip install pytest autoflake black isort cryptography==3.4.8 tpm2_pytss
#if: steps.cache-virtualenv.outputs.cache-hit != 'true'
- run: pip freeze
- name: Test
run: python -m pytest
bats:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Install dependencies
run: sudo apt install -y libpcap-dev bats
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: syphar/restore-virtualenv@v1
id: cache-virtualenv
# looks for changes in requirements.txt
with:
requirement_files: requirements.txt
- uses: syphar/restore-pip-download-cache@v1
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
# the package installation will only be executed when the
# requirements-files have changed.
- run: pip install .
#if: steps.cache-virtualenv.outputs.cache-hit != 'true'
- name: Test
run: bats test/*.bats
linters:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: sudo apt install -y libpcap-dev
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: syphar/restore-virtualenv@v1
id: cache-virtualenv
# looks for changes in requirements.txt
with:
requirement_files: requirements.txt
- uses: syphar/restore-pip-download-cache@v1
if: steps.cache-virtualenv.outputs.cache-hit != 'true'
# the package installation will only be executed when the
# requirements-files have changed.
- run: pip install .; pip install pytest autoflake black isort
#if: steps.cache-virtualenv.outputs.cache-hit != 'true'
- name: Linting
run: scripts/linters.sh --check