From 254957ec08e56237b7a0ce77978f01044e3c137f Mon Sep 17 00:00:00 2001 From: mozillazg Date: Fri, 26 Apr 2024 21:49:52 +0800 Subject: [PATCH] ci: add actions --- .github/dependabot.yml | 12 ++++++++++++ .github/workflows/test.yml | 34 ++++++++++++++++++++++++++++++++++ Makefile | 2 +- 3 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..6a3f63bc --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: gomod + directory: / + open-pull-requests-limit: 10 + schedule: + interval: monthly + - package-ecosystem: github-actions + directory: / + open-pull-requests-limit: 5 + schedule: + interval: monthly diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..6f387990 --- /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@v5 + 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..65701fda 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ $(LIBPCAP_OBJ): $(LIBPCAP_SRC) $(wildcard $(LIBPCAP_SRC)/*.[ch]) | $(LIBPCAP_DIS $(MAKE) install prefix=$(LIBPCAP_DIST_DIR) $(LIBPCAP_SRC): -ifeq ($(wildcard $@), ) +ifeq ($(wildcard $@/configure), ) echo "INFO: updating submodule 'libpcap'" $(GIT) submodule update --init --recursive endif