diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..69bef367 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: / + open-pull-requests-limit: 10 + schedule: + interval: monthly diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..8257e88a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: Test + +on: + workflow_dispatch: + push: + branches: [ "master", "dev" ] + pull_request: + branches: [ "master", "dev" ] + +permissions: + contents: read + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.21' + + - name: Set up deps + run: | + sudo apt-get install -y gcc flex bison make + + - name: Build + run: make build + + - name: Test + run: go test -v ./... + diff --git a/Makefile b/Makefile index ba943776..56aa957c 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ CGO_LDFLAGS_STATIC = "-L$(LIBPCAP_OBJ_DIR) -lelf -lz $(LIBPCAP_OBJ)" .PHONY: libpcap libpcap: $(LIBPCAP_OBJ) -$(LIBPCAP_OBJ): $(LIBPCAP_SRC) $(wildcard $(LIBPCAP_SRC)/*.[ch]) | $(LIBPCAP_DIST_DIR) +$(LIBPCAP_OBJ): $(LIBPCAP_SRC) $(wildcard $(LIBPCAP_SRC)/*.[ch]) $(LIBPCAP_DIST_DIR) cd $(LIBPCAP_SRC) && \ ./configure --enable-dbus=no && \ $(MAKE) && \ @@ -32,8 +32,7 @@ ifeq ($(wildcard $@), ) $(GIT) submodule update --init --recursive endif -$(LIBPCAP_DIST_DIR): $(OUTPUT) - mkdir -p $(LIBPCAP_DIST_DIR) +$(LIBPCAP_DIST_DIR): $(LIBPCAP_SRC) $(OUTPUT): mkdir -p $(OUTPUT)