Skip to content

Commit

Permalink
CI: cache zeek builds
Browse files Browse the repository at this point in the history
AlyaGomaa committed Oct 31, 2024
1 parent e80c38a commit ccff6dd
Showing 1 changed file with 34 additions and 12 deletions.
46 changes: 34 additions & 12 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
@@ -7,9 +7,38 @@ on:
- 'develop'

jobs:
build-zeek:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: ''

- name: Enable memory overcommit (for redis)
run: sysctl vm.overcommit_memory=1

- name: Install dependencies
run: sudo apt-get update --fix-missing && sudo apt-get -y --no-install-recommends install python3 redis-server python3-pip python3-certifi python3-dev build-essential file lsof net-tools iproute2 iptables python3-tzlocal nfdump tshark git whois golang nodejs notify-osd yara libnotify-bin

- name: Install Zeek
run: |
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: Cache Zeek Build
uses: actions/cache@v3
with:
path: /opt/zeek
key: ${{ runner.os }}-zeek

tests:
runs-on: ubuntu-22.04
timeout-minutes: 1800
# make this one depend on the first job
needs: build-zeek

strategy:
matrix:
@@ -71,18 +100,11 @@ jobs:
ref: ${{ github.ref }}
fetch-depth: ''

- name: Enable memory overcommit (for redis)
run: sysctl vm.overcommit_memory=1

- name: Install slips dependencies
run: sudo apt-get update --fix-missing && sudo apt-get -y --no-install-recommends install python3 redis-server python3-pip python3-certifi python3-dev build-essential file lsof net-tools iproute2 iptables python3-tzlocal nfdump tshark git whois golang nodejs notify-osd yara libnotify-bin

- 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: Restore Zeek Build from Cache
uses: actions/cache@v3
with:
path: /opt/zeek
key: ${{ runner.os }}-zeek

- name: Set up Python 3.10.12
uses: actions/setup-python@v5

0 comments on commit ccff6dd

Please sign in to comment.