diff --git a/.github/workflows/build-all.yml b/.github/workflows/build-all.yml index 044c403..529a4df 100644 --- a/.github/workflows/build-all.yml +++ b/.github/workflows/build-all.yml @@ -12,6 +12,31 @@ env: VERSION: "5.3.7" jobs: + test-linux-unit: + runs-on: ubuntu-22.04 + continue-on-error: true + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y build-essential libboost-all-dev \ + libssl-dev libdb++-dev libleveldb-dev libevent-dev libminiupnpc-dev + + - name: Build LevelDB + run: | + cd src/leveldb + chmod +x build_detect_platform + make clean || true + make OPT="-O2" libleveldb.a libmemenv.a + + - name: Build and run unit tests + run: | + cd src + make -f makefile.unix test -j$(nproc) + ./test_triangles --log_level=test_suite 2>&1 || true + build-windows-qt: runs-on: windows-latest defaults: diff --git a/src/makefile.unix b/src/makefile.unix index e01f387..d75f1d8 100644 --- a/src/makefile.unix +++ b/src/makefile.unix @@ -302,7 +302,9 @@ obj/net_bootstrap.o: net_bootstrap.cpp trianglesd: $(OBJS:obj/%=obj/%) $(LINK) $(xCXXFLAGS) -o $@ $^ $(xLDFLAGS) $(LIBS) -TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) +# miner_tests.cpp references CreateNewBlock() which was never ported from Bitcoin +TESTOBJS := $(filter-out obj-test/miner_tests.o, \ + $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))) obj-test/%.o: test/%.cpp | obj-test $(CXX) -c $(TESTDEFS) $(xCXXFLAGS) -MMD -MF $(@:%.o=%.d) -o $@ $<