Skip to content

Commit 65e6609

Browse files
Add GitHub CI checks for Debian, Gentoo, Arch, CentOS, and Fedora (zmap#780)
* fist pass at a debian workflow * Refactored debian workflow into a common bsd/linux yml. Edited Dockerfile * attempt tumi8#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
1 parent 06d2647 commit 65e6609

9 files changed

Lines changed: 181 additions & 102 deletions

File tree

.github/workflows/arch.Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM archlinux:latest
2+
3+
RUN pacman-key --init
4+
RUN pacman -Syu --noconfirm
5+
RUN pacman -S --noconfirm base-devel cmake gmp gengetopt libpcap flex byacc json-c pkg-config libunistring judy python
6+
RUN pacman -Scc --noconfirm
7+
8+
WORKDIR /zmap
9+
10+
COPY . .
11+
12+
RUN ls
13+
RUN cmake -DENABLE_DEVELOPMENT=$ENABLE_DEVELOPMENT -DENABLE_LOG_TRACE=$ENABLE_LOG_TRACE .
14+
RUN make
15+
RUN cd ..
16+
RUN python ./scripts/check_manfile.py

.github/workflows/cmake-freebsd.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.github/workflows/cmake-macos.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

.github/workflows/cmake-ubuntu.yml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/cmake.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: CMake
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
ENABLE_DEVELOPMENT: ON
11+
ENABLE_LOG_TRACE: ON
12+
13+
jobs:
14+
build-ubuntu:
15+
runs-on: ubuntu-20.04
16+
container:
17+
image: ghcr.io/zmap/builder:2023-09-10
18+
volumes:
19+
- ${{github.workspace}}:/zmap
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Make build directory
24+
run: mkdir -p /zmap/build
25+
26+
- name: Configure CMake
27+
working-directory: /zmap/build
28+
# Configure CMake in a 'build' subdirectory.
29+
run: cmake -DENABLE_DEVELOPMENT=${{env.ENABLE_DEVELOPMENT}} -DENABLE_LOG_TRACE=${{env.ENABLE_LOG_TRACE}} /zmap
30+
31+
- name: Build
32+
working-directory: /zmap/build
33+
# Build your program with the given configuration
34+
run: make
35+
36+
- name: Check Manpages
37+
working-directory: /zmap
38+
run: python3 ./scripts/check_manfile.py
39+
40+
build-debian:
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Checkout Repository
44+
uses: actions/checkout@v2
45+
- name: Check Debian Compilation
46+
run: |
47+
docker build -t debian-container -f .github/workflows/debian.Dockerfile .
48+
docker run debian-container
49+
50+
build-arch:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- name: Checkout Repository
54+
uses: actions/checkout@v2
55+
- name: Check Arch Compilation
56+
run: |
57+
docker build -t arch-container -f .github/workflows/arch.Dockerfile .
58+
docker run arch-container
59+
60+
build-fedora:
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: Checkout Repository
64+
uses: actions/checkout@v2
65+
- name: Check Fedora Compilation
66+
run: |
67+
docker build -t fedora-container -f .github/workflows/fedora.Dockerfile .
68+
docker run fedora-container
69+
70+
build-gentoo:
71+
runs-on: ubuntu-latest
72+
steps:
73+
- name: Checkout Repository
74+
uses: actions/checkout@v2
75+
- name: Check Gentoo Compilation
76+
run: |
77+
docker build -t gentoo-container -f .github/workflows/gentoo.Dockerfile .
78+
docker run gentoo-container
79+
80+
build-mac:
81+
runs-on: macos-14
82+
steps:
83+
- uses: actions/checkout@v2
84+
85+
- name: Download dependencies
86+
run: brew install pkg-config cmake gmp gengetopt json-c byacc libunistring judy
87+
88+
- name: Configure CMake
89+
# Configure CMake in a 'build' subdirectory.
90+
run: cmake -DENABLE_DEVELOPMENT=${{env.ENABLE_DEVELOPMENT}} -DENABLE_LOG_TRACE=${{env.ENABLE_LOG_TRACE}} .
91+
92+
- name: Build
93+
# Build your program with the given configuration
94+
run: make
95+
96+
- name: Check Manpages
97+
run: python3 ./scripts/check_manfile.py
98+
99+
build-freebsd:
100+
runs-on: ubuntu-latest
101+
steps:
102+
- uses: actions/checkout@v4
103+
- name: Test in FreeBSD
104+
id: test
105+
uses: vmactions/freebsd-vm@v1
106+
with:
107+
envs: 'ENABLE_DEVELOPMENT ENABLE_LOG_TRACE'
108+
usesh: true
109+
prepare: |
110+
freebsd-update fetch
111+
freebsd-update install
112+
pkg install -y judy byacc cmake flex gengetopt gmp json-c libunistring influxpkg-config python3
113+
run: cd ~/work/zmap/zmap && cmake -DENABLE_DEVELOPMENT=${{env.ENABLE_DEVELOPMENT}} -DENABLE_LOG_TRACE=${{env.ENABLE_LOG_TRACE}} . && make && python3 ./scripts/check_manfile.py
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM debian:latest
2+
3+
RUN apt-get update \
4+
&& apt-get install -y build-essential cmake libgmp3-dev gengetopt libpcap-dev flex \
5+
byacc libjson-c-dev pkg-config libunistring-dev libjudy-dev cmake make python3 \
6+
&& apt-get clean \
7+
&& rm -rf /var/lib/apt/lists/*
8+
9+
WORKDIR /zmap
10+
11+
COPY . .
12+
13+
RUN cmake -DENABLE_DEVELOPMENT=$ENABLE_DEVELOPMENT -DENABLE_LOG_TRACE=$ENABLE_LOG_TRACE . \
14+
&& make
15+
RUN python3 ./scripts/check_manfile.py
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM fedora:latest
2+
3+
RUN dnf update -y \
4+
&& dnf install -y gcc cmake gmp-devel gengetopt libpcap-devel flex byacc json-c-devel libunistring-devel Judy-devel python3 \
5+
&& dnf clean all
6+
7+
WORKDIR /zmap
8+
9+
COPY . .
10+
11+
RUN cmake -DENABLE_DEVELOPMENT=$ENABLE_DEVELOPMENT -DENABLE_LOG_TRACE=$ENABLE_LOG_TRACE . \
12+
&& make
13+
RUN python3 ./scripts/check_manfile.py
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM gentoo/stage3:latest
2+
3+
RUN emaint -a sync
4+
#RUN emerge --sync
5+
RUN emerge sys-devel/binutils dev-libs/gmp dev-util/gengetopt net-libs/libpcap sys-devel/flex dev-util/byacc dev-libs/json-c \
6+
dev-util/pkgconf dev-libs/libunistring dev-libs/judy
7+
8+
WORKDIR /zmap
9+
10+
COPY . .
11+
12+
RUN cmake -DENABLE_DEVELOPMENT=$ENABLE_DEVELOPMENT -DENABLE_LOG_TRACE=$ENABLE_LOG_TRACE . \
13+
&& make
14+
RUN python3 ./scripts/check_manfile.py

INSTALL.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,16 @@ Install the required dependencies with the following commands.
3838

3939
* On RHEL- and Fedora-based systems (including CentOS):
4040
```sh
41-
sudo yum install gcc cmake gmp-devel gengetopt libpcap-devel flex byacc json-c-devel libunistring-devel Judy-devel
41+
sudo dnf install gcc cmake gmp-devel gengetopt libpcap-devel flex byacc json-c-devel libunistring-devel Judy-devel
42+
```
43+
* On Arch systems
44+
```sh
45+
pacman -S base-devel cmake gmp gengetopt libpcap flex byacc json-c pkg-config libunistring judy python
46+
```
47+
48+
* On Gentoo systems
49+
```sh
50+
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
4251
```
4352

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

0 commit comments

Comments
 (0)