From 2d234386c833d1ee6cc266ccde8754db5e4cde05 Mon Sep 17 00:00:00 2001 From: Nye Liu Date: Sun, 27 Oct 2024 00:20:41 -0700 Subject: [PATCH] Add basic CI, move broken bins to broken so make test succeeds --- .github/workflows/c-cpp.yml | 23 +++++++++++++++++++++++ GNUmakefile | 4 ++++ bins/{ => broken}/ferrari360.bin | Bin bins/{ => broken}/ferrari360.ini | 0 test.sh | 10 ++++++++-- 5 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/c-cpp.yml rename bins/{ => broken}/ferrari360.bin (100%) rename bins/{ => broken}/ferrari360.ini (100%) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml new file mode 100644 index 0000000..4be18d6 --- /dev/null +++ b/.github/workflows/c-cpp.yml @@ -0,0 +1,23 @@ +name: C/C++ CI + +on: + push: +# branches: [ $default-branch ] + pull_request: + branches: [ $default-branch ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: install libgmp-dev + run: | + sudo apt-get update + sudo apt-get install -y libgmp-dev + - uses: actions/checkout@v4 + - name: make + run: make + - name: make test + run: make test diff --git a/GNUmakefile b/GNUmakefile index e91f978..e41790a 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -11,6 +11,10 @@ endif include makefile.common +.PHONY: test +test: + ./test.sh + win: force ./build.cmd clean ./build.cmd diff --git a/bins/ferrari360.bin b/bins/broken/ferrari360.bin similarity index 100% rename from bins/ferrari360.bin rename to bins/broken/ferrari360.bin diff --git a/bins/ferrari360.ini b/bins/broken/ferrari360.ini similarity index 100% rename from bins/ferrari360.ini rename to bins/broken/ferrari360.ini diff --git a/test.sh b/test.sh index 5d0ce4d..f8a37ac 100755 --- a/test.sh +++ b/test.sh @@ -1,5 +1,11 @@ #!/bin/sh + +rm -f err.log +trap "rm -rf err.log" EXIT for i in bins/*.bin; do - ./me7sum -r $i.txt $i | grep -E '(ABORT|WARNING)' - grep ERROR $i.txt + ./me7sum -r $i.txt $i | grep -E '(ABORT|WARNING)' >> err.log + grep ERROR $i.txt >> err.log done + +cat err.log +[ ! -s err.log ]