Skip to content

Commit 9509294

Browse files
authored
make : add test and update CI (#2897)
* build ci: run make test * makefile: - add all - add test * enable tests/test-tokenizer-0-llama * fix path to model * remove gcc-8 from macos build test * Update Makefile * Update Makefile
1 parent 35092fb commit 9509294

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/build.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ jobs:
4141
run: |
4242
CC=gcc-8 make
4343
44+
- name: Test
45+
id: make_test
46+
run: |
47+
CC=gcc-8 make tests
48+
make test
49+
4450
ubuntu-latest-cmake:
4551
runs-on: ubuntu-latest
4652

@@ -157,6 +163,12 @@ jobs:
157163
run: |
158164
make
159165
166+
- name: Test
167+
id: make_test
168+
run: |
169+
make tests
170+
make test
171+
160172
macOS-latest-cmake:
161173
runs-on: macos-latest
162174

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ TEST_TARGETS = tests/test-llama-grammar tests/test-grammar-parser tests/test-dou
66

77
default: $(BUILD_TARGETS)
88

9+
test:
10+
@echo "Running tests..."
11+
@for test_target in $(TEST_TARGETS); do \
12+
if [ "$$test_target" = "tests/test-tokenizer-0-llama" ]; then \
13+
./$$test_target $(CURDIR)/models/ggml-vocab-llama.gguf; \
14+
elif [ "$$test_target" = "tests/test-tokenizer-0-falcon" ]; then \
15+
continue; \
16+
elif [ "$$test_target" = "tests/test-tokenizer-1" ]; then \
17+
continue; \
18+
else \
19+
./$$test_target; \
20+
fi; \
21+
done
22+
@echo "All tests have been run."
23+
24+
all: $(BUILD_TARGETS) $(TEST_TARGETS)
25+
926
ifndef UNAME_S
1027
UNAME_S := $(shell uname -s)
1128
endif

0 commit comments

Comments
 (0)