Skip to content

Commit

Permalink
ci: minimal CI testing setup
Browse files Browse the repository at this point in the history
Add static and shared build and runtime testing.
  • Loading branch information
anakryiko committed Nov 19, 2024
1 parent 6b242f8 commit 7f8efcd
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: USDT CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- 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
7 changes: 4 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
) \
Expand All @@ -59,6 +59,7 @@ clean:

.PHONY: list
list:
$(call msg,TESTS,$@)
$(Q)$(foreach test,$(TESTS), $(info $(test)))

.PHONY: build
Expand Down

0 comments on commit 7f8efcd

Please sign in to comment.