-
Notifications
You must be signed in to change notification settings - Fork 180
83 lines (66 loc) · 2.32 KB
/
integration-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
name: integration-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
integration-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_config_files.py
- test_portscans.py
- test_dataset.py
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: ''
- name: Restore Zeek Build from Cache
id: zeek-cache
uses: actions/cache@v4
with:
path: /opt/zeek
key: zeek-cache
- name: Restore APT cache
id: apt-cache
uses: actions/cache@v4
with:
path: |
/var/cache/apt/archives
/var/lib/apt/lists
key: apt-cache
- name: Install Zeek
run: |
sudo echo 'deb http://download.opensuse.org/repositories/security:/zeek/xUbuntu_22.04/ /' | sudo tee /etc/apt/sources.list.d/security:zeek.list
curl -fsSL https://download.opensuse.org/repositories/security:zeek/xUbuntu_22.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/security_zeek.gpg > /dev/null
sudo apt update && sudo apt install -y --no-install-recommends --fix-missing zeek
sudo ln -s /opt/zeek/bin/zeek /usr/local/bin/bro
- name: Install apt dependencies (from cache if possible)
run: |
sudo apt-get update
sudo apt-get install -y $(cat install/apt_dependencies.txt)
- name: Install Python dependencies (from cache if possible)
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r install/requirements.txt
- name: Start redis server
run: redis-server --daemonize yes
- name: Run Integration Tests for ${{ matrix.test_file }}
run: |
python3 -m pytest tests/integration_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