Skip to content

Commit

Permalink
ci: add actions
Browse files Browse the repository at this point in the history
  • Loading branch information
mozillazg committed Apr 26, 2024
1 parent 8d9b458 commit e5447bf
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: gomod
directory: /
open-pull-requests-limit: 10
schedule:
interval: monthly
34 changes: 34 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -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 ./...

5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) && \
Expand All @@ -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)
Expand Down

0 comments on commit e5447bf

Please sign in to comment.