diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 346b51be0..1bed8cbe3 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -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