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 2a924ff
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -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
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@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 ./...

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ 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)/configure $(wildcard $(LIBPCAP_SRC)/*.[ch]) | $(LIBPCAP_DIST_DIR)
cd $(LIBPCAP_SRC) && \
./configure --enable-dbus=no && \
$(MAKE) && \
$(MAKE) install prefix=$(LIBPCAP_DIST_DIR)

$(LIBPCAP_SRC):
$(LIBPCAP_SRC)/configure:
ifeq ($(wildcard $@), )
echo "INFO: updating submodule 'libpcap'"
$(GIT) submodule update --init --recursive
Expand Down

0 comments on commit 2a924ff

Please sign in to comment.