-
Notifications
You must be signed in to change notification settings - Fork 183
129 lines (114 loc) · 3.52 KB
/
unit-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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: unit-tests
on:
pull_request:
branches:
- 'master'
- 'develop'
jobs:
# uses the common workflow that builds slips
install-dependencies-using-reusable-workflow:
uses: ./.github/workflows/install-slips-dependencies.yml
unit-tests:
runs-on: ubuntu-22.04
timeout-minutes: 1800
# make this job depend on the first job
needs: install-dependencies-using-reusable-workflow
strategy:
matrix:
test_file:
- test_inputProc.py
- test_main.py
- test_conn.py
- test_downloaded_file.py
- test_ssl.py
- test_tunnel.py
- test_ssh.py
- test_dns.py
- test_notice.py
- test_software.py
- test_smtp.py
- test_whitelist.py
- test_arp.py
- test_blocking.py
- test_flow_handler.py
- test_horizontal_portscans.py
- test_http_analyzer.py
- test_vertical_portscans.py
- test_network_discovery.py
- test_virustotal.py
- test_update_file_manager.py
- test_threat_intelligence.py
- test_slips_utils.py
- test_slips.py
- test_profiler.py
- test_leak_detector.py
- test_ip_info.py
- test_evidence.py
- test_asn_info.py
- test_urlhaus.py
- test_markov_chain.py
- test_daemon.py
- test_go_director.py
- test_notify.py
- test_checker.py
- test_base_model.py
- test_set_evidence.py
- test_trustdb.py
- test_cesnet.py
- test_output.py
- test_riskiq.py
- test_spamhaus.py
- test_circllu.py
- test_evidence_handler.py
- test_alert_handler.py
- test_redis_manager.py
- test_ioc_handler.py
- test_timeline.py
- test_database.py
- test_symbols_handler.py
- test_profile_handler.py
- test_process_manager.py
- test_metadata_manager.py
- test_host_ip_manager.py
- test_host_ip_manager.py
- test_rnn_cc_detection.py
- test_idea_format.py
- test_fides_sqlite_db.py
- test_fides_module.py
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: ''
- name: Restore APT cache
id: apt-cache
uses: actions/cache@v4
with:
path: |
/var/cache/apt/archives
/var/lib/apt/lists
key: apt-cache
- if: ${{ steps.apt-cache.outputs.cache-hit == 'true' }}
name: Echo restored from cache
continue-on-error: true
run: echo "Restored APT dependencies from cache successfully"
- name: Install Python dependencies (from cache if possible)
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r install/requirements.txt
- name: Install apt dependencies (from cache if possible)
run: |
sudo apt-get update
sudo apt-get install -y $(cat install/apt_dependencies.txt)
- name: Start redis server
run: redis-server --daemonize yes
- name: Run Unit Tests for ${{ matrix.test_file }}
run: |
python3 -m pytest tests/${{ matrix.test_file }} -p no:warnings -vv -s -n 5
- name: Upload Artifacts
if: success() || failure()
uses: actions/upload-artifact@v3
with:
name: test_slips_locally-integration-tests-output
path: |
output/integration_tests