-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.91 KB
/
build_test_ci.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
name: Build, Test, and Execute C Program
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential libjansson-dev
- name: Compile C Program
run: gcc -o suricata-notify suricata-notify.c -ljansson
- name: Upload Build Artifact
uses: actions/upload-artifact@v3
with:
name: suricata-notify
path: suricata-notify
retention-days: 30
download:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download Artifact
uses: actions/download-artifact@v3
with:
name: suricata-notify
path: ./
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential xvfb libnotify-bin strace
- name: List Downloaded Files
run: ls -la
- name: Make Executable
run: chmod +x suricata-notify
- name: Create Test Data
run: echo '[{"event_type":"alert","timestamp":"2023-08-02T00:05:06.384656+0200","alert":{"signature":"Test Signature 1","category":"Test Category 1"}},{"event_type":"alert","timestamp":"2023-08-02T00:06:00.000000+0200","alert":{"signature":"Test Signature 2","category":"Test Category 2"}},{"event_type":"alert","timestamp":"2023-08-02T00:07:00.000000+0200","alert":{"signature":"Test Signature 3","category":"Test Category 3"}}]' > eve.json
- name: Prepare Virtual Display
run: xvfb-run -a -s "-screen 0 1024x768x24" sh -c "strace -o strace.log ./suricata-notify eve.json"
- name: Upload Strace Log
uses: actions/upload-artifact@v3
with:
name: strace-log
path: strace.log
retention-days: 30