Skip to content

Commit

Permalink
Add GitHub CI checks for Debian, Gentoo, Arch, CentOS, and Fedora (zm…
Browse files Browse the repository at this point in the history
…ap#780)

* fist pass at a debian workflow

* Refactored debian workflow into a common bsd/linux yml. Edited Dockerfile

* attempt #2

* attempt tumi8#3

* attempt tumi8#4

* attempt tumi8#5

* attempt tumi8#6

* attempt tumi8#7

* attempt tumi8#8

* attempt tumi8#9

* attempt tumi8#10, at least we're getting into the debian dockerfile

* Looks like its working, causing a compile error in get_gateway_linux to see if check fails

* Confirmed, debian workflow is working!

* Removed debugging ls in .yml

* testing arch build

* Added fedora test

* testing Gentoo test

* phillip/773: refactored all the github compile actions to be in a single .yml file

* phillip/773: added arch and gentoo Install instructions

* phillip/773: removed extra space in arch.Dockerfile

* phillip/773: apparently the free-bsd vm is picky about having the run being on the same line
  • Loading branch information
phillip-stephens authored Feb 14, 2024
1 parent 06d2647 commit 65e6609
Show file tree
Hide file tree
Showing 9 changed files with 181 additions and 102 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/arch.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM archlinux:latest

RUN pacman-key --init
RUN pacman -Syu --noconfirm
RUN pacman -S --noconfirm base-devel cmake gmp gengetopt libpcap flex byacc json-c pkg-config libunistring judy python
RUN pacman -Scc --noconfirm

WORKDIR /zmap

COPY . .

RUN ls
RUN cmake -DENABLE_DEVELOPMENT=$ENABLE_DEVELOPMENT -DENABLE_LOG_TRACE=$ENABLE_LOG_TRACE .
RUN make
RUN cd ..
RUN python ./scripts/check_manfile.py
28 changes: 0 additions & 28 deletions .github/workflows/cmake-freebsd.yml

This file was deleted.

35 changes: 0 additions & 35 deletions .github/workflows/cmake-macos.yml

This file was deleted.

38 changes: 0 additions & 38 deletions .github/workflows/cmake-ubuntu.yml

This file was deleted.

113 changes: 113 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: CMake

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
ENABLE_DEVELOPMENT: ON
ENABLE_LOG_TRACE: ON

jobs:
build-ubuntu:
runs-on: ubuntu-20.04
container:
image: ghcr.io/zmap/builder:2023-09-10
volumes:
- ${{github.workspace}}:/zmap
steps:
- uses: actions/checkout@v2

- name: Make build directory
run: mkdir -p /zmap/build

- name: Configure CMake
working-directory: /zmap/build
# Configure CMake in a 'build' subdirectory.
run: cmake -DENABLE_DEVELOPMENT=${{env.ENABLE_DEVELOPMENT}} -DENABLE_LOG_TRACE=${{env.ENABLE_LOG_TRACE}} /zmap

- name: Build
working-directory: /zmap/build
# Build your program with the given configuration
run: make

- name: Check Manpages
working-directory: /zmap
run: python3 ./scripts/check_manfile.py

build-debian:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Check Debian Compilation
run: |
docker build -t debian-container -f .github/workflows/debian.Dockerfile .
docker run debian-container
build-arch:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Check Arch Compilation
run: |
docker build -t arch-container -f .github/workflows/arch.Dockerfile .
docker run arch-container
build-fedora:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Check Fedora Compilation
run: |
docker build -t fedora-container -f .github/workflows/fedora.Dockerfile .
docker run fedora-container
build-gentoo:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Check Gentoo Compilation
run: |
docker build -t gentoo-container -f .github/workflows/gentoo.Dockerfile .
docker run gentoo-container
build-mac:
runs-on: macos-14
steps:
- uses: actions/checkout@v2

- name: Download dependencies
run: brew install pkg-config cmake gmp gengetopt json-c byacc libunistring judy

- name: Configure CMake
# Configure CMake in a 'build' subdirectory.
run: cmake -DENABLE_DEVELOPMENT=${{env.ENABLE_DEVELOPMENT}} -DENABLE_LOG_TRACE=${{env.ENABLE_LOG_TRACE}} .

- name: Build
# Build your program with the given configuration
run: make

- name: Check Manpages
run: python3 ./scripts/check_manfile.py

build-freebsd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Test in FreeBSD
id: test
uses: vmactions/freebsd-vm@v1
with:
envs: 'ENABLE_DEVELOPMENT ENABLE_LOG_TRACE'
usesh: true
prepare: |
freebsd-update fetch
freebsd-update install
pkg install -y judy byacc cmake flex gengetopt gmp json-c libunistring influxpkg-config python3
run: cd ~/work/zmap/zmap && cmake -DENABLE_DEVELOPMENT=${{env.ENABLE_DEVELOPMENT}} -DENABLE_LOG_TRACE=${{env.ENABLE_LOG_TRACE}} . && make && python3 ./scripts/check_manfile.py
15 changes: 15 additions & 0 deletions .github/workflows/debian.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM debian:latest

RUN apt-get update \
&& apt-get install -y build-essential cmake libgmp3-dev gengetopt libpcap-dev flex \
byacc libjson-c-dev pkg-config libunistring-dev libjudy-dev cmake make python3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /zmap

COPY . .

RUN cmake -DENABLE_DEVELOPMENT=$ENABLE_DEVELOPMENT -DENABLE_LOG_TRACE=$ENABLE_LOG_TRACE . \
&& make
RUN python3 ./scripts/check_manfile.py
13 changes: 13 additions & 0 deletions .github/workflows/fedora.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM fedora:latest

RUN dnf update -y \
&& dnf install -y gcc cmake gmp-devel gengetopt libpcap-devel flex byacc json-c-devel libunistring-devel Judy-devel python3 \
&& dnf clean all

WORKDIR /zmap

COPY . .

RUN cmake -DENABLE_DEVELOPMENT=$ENABLE_DEVELOPMENT -DENABLE_LOG_TRACE=$ENABLE_LOG_TRACE . \
&& make
RUN python3 ./scripts/check_manfile.py
14 changes: 14 additions & 0 deletions .github/workflows/gentoo.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM gentoo/stage3:latest

RUN emaint -a sync
#RUN emerge --sync
RUN emerge sys-devel/binutils dev-libs/gmp dev-util/gengetopt net-libs/libpcap sys-devel/flex dev-util/byacc dev-libs/json-c \
dev-util/pkgconf dev-libs/libunistring dev-libs/judy

WORKDIR /zmap

COPY . .

RUN cmake -DENABLE_DEVELOPMENT=$ENABLE_DEVELOPMENT -DENABLE_LOG_TRACE=$ENABLE_LOG_TRACE . \
&& make
RUN python3 ./scripts/check_manfile.py
11 changes: 10 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,16 @@ Install the required dependencies with the following commands.

* On RHEL- and Fedora-based systems (including CentOS):
```sh
sudo yum install gcc cmake gmp-devel gengetopt libpcap-devel flex byacc json-c-devel libunistring-devel Judy-devel
sudo dnf install gcc cmake gmp-devel gengetopt libpcap-devel flex byacc json-c-devel libunistring-devel Judy-devel
```
* On Arch systems
```sh
pacman -S base-devel cmake gmp gengetopt libpcap flex byacc json-c pkg-config libunistring judy python
```

* On Gentoo systems
```sh
emerge sys-devel/binutils dev-libs/gmp dev-util/gengetopt net-libs/libpcap sys-devel/flex dev-util/byacc dev-libs/json-c dev-util/pkgconf dev-libs/libunistring dev-libs/judy
```

* On macOS systems (using [Homebrew](https://brew.sh/)):
Expand Down

0 comments on commit 65e6609

Please sign in to comment.