diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..333c208 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,30 @@ +name: USDT CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install prerequisites + run: apt-get install -y bpftrace sudo + + - name: Build (static) + run: make SHARED=0 -C tests -j$(nproc) build + + - name: Build (shared) + run: make SHARED=1 -C tests -j$(nproc) build + + - name: Test (static) + run: make SHARED=0 -C tests test + + - name: Test (shared) + run: make SHARED=1 -C tests test diff --git a/tests/Makefile b/tests/Makefile index 4d27eef..b971d3c 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -34,13 +34,13 @@ endif NONTESTS = tester common TESTS := $(filter-out $(NONTESTS), \ - $(shell ls *.{c,cpp} 2>/dev/null | grep -v '^lib' | \ - ${AWK} '{split($$0, p, /[^A-Za-z_]+/); print p[1]}' | \ + $(shell ls *.c *.cpp 2>/dev/null | grep -v '^lib' | \ + ${AWK} '{split($$0, p, /[^A-Za-z_]+/); print p[1]}' | \ sort | uniq \ ) \ ) LIBS := $(filter-out $(NONTESTS), \ - $(shell ls lib*.{c,cpp} 2>/dev/null | \ + $(shell ls lib*.c lib*.cpp 2>/dev/null | \ ${AWK} '{split($$0, p, /[^A-Za-z_]+/); print substr(p[1], 4)}' | \ sort | uniq \ ) \ @@ -59,6 +59,7 @@ clean: .PHONY: list list: + $(call msg,TESTS,$@) $(Q)$(foreach test,$(TESTS), $(info $(test))) .PHONY: build