From 66010be5a6ef2a545f0e3937fde3a344cc1bd284 Mon Sep 17 00:00:00 2001 From: "Sergio R. Caprile" Date: Thu, 20 Jul 2023 20:16:48 -0300 Subject: [PATCH] move Arduino tests to its dir --- .github/workflows/test.yml | 24 ++++++++++++++++-------- Makefile | 26 +------------------------- examples/arduino/Makefile | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 33 deletions(-) create mode 100644 examples/arduino/Makefile diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 456e85c1..3d767877 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -75,14 +75,6 @@ jobs: - run: if ./test/match_changed_files.sh '^test|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi - if: ${{ env.GO == 1 }} run: make vc98 vc17 vc22 mingw mingw++ - arduino-xiao: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: { fetch-depth: 2 } - - run: if ./test/match_changed_files.sh '^examples/arduino|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi - - if: ${{ env.GO == 1 }} - run: make arduino-xiao arm: runs-on: ubuntu-latest steps: @@ -122,6 +114,7 @@ jobs: - run: make examples_mac - run: make clean_examples_mac + test_f7: runs-on: ubuntu-latest steps: @@ -206,6 +199,21 @@ jobs: - if: ${{ env.GO == 1 }} run: make -C examples/rp2040/pico-w5500 test VCON_API_KEY=${{secrets.VCON_API_KEY}} + + arduino: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: { fetch-depth: 2 } + - run: if ./test/match_changed_files.sh '^examples/arduino|^src/.*.[ch]' ; then echo GO=1 >> $GITHUB_ENV ; fi + - if: ${{ env.GO == 1 }} + run: make -C examples/arduino arduino-xiao +# - if: ${{ env.GO == 1 }} +# run: make -C examples/arduino arduino-nano + - if: ${{ env.GO == 1 }} + run: make -C examples/arduino clean + + matrix_examples: runs-on: ubuntu-latest strategy: diff --git a/Makefile b/Makefile index b532f99f..c89dfaf4 100644 --- a/Makefile +++ b/Makefile @@ -154,30 +154,6 @@ mingw: Makefile mongoose.h $(SRCS) $(DOCKER) mdashnet/mingw x86_64-w64-mingw32-gcc $(SRCS) -W -Wall -Werror -I. $(DEFS) -lwsock32 -o $@.exe $(DOCKER) mdashnet/mingw wine64 $@.exe -arduino: ENV = -v $(CWD)/arduino:/root -arduino: - curl -sL http://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz | unxz | tar -xf - - mv arduino-* $@ - -arduino-xiao-board: - $(DOCKER) mdashnet/cc2 ./arduino/arduino --pref "boardsmanager.additional.urls=https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json" --save-prefs - $(DOCKER) mdashnet/cc2 ./arduino/arduino --pref "compiler.warning_level=all" --save-prefs - $(DOCKER) mdashnet/cc2 ./arduino/arduino --install-boards Seeeduino:samd - -arduino-xiao: ENV = -v $(CWD)/arduino:/root -arduino-xiao: arduino arduino-xiao-board - rm -rf tmp; mkdir tmp - cp examples/arduino/w5500/w5500.ino tmp/tmp.ino - cp mongoose.c mongoose.h examples/arduino/w5500/mongoose_custom.h tmp/ - $(DOCKER) mdashnet/cc2 ./arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 tmp/tmp.ino - -arduino-nano: ENV = -v $(CWD)/arduino:/root -arduino-nano: arduino - rm -rf tmp; mkdir tmp - cp examples/arduino/w5500/w5500.ino tmp/tmp.ino - cp mongoose.c mongoose.h examples/arduino/w5500/mongoose_custom.h tmp/ - $(DOCKER) mdashnet/cc2 ./arduino/arduino --verbose --verify --board arduino:avr:nano tmp/tmp.ino - mingw++: Makefile mongoose.h $(SRCS) $(DOCKER) mdashnet/mingw x86_64-w64-mingw32-g++ $(SRCS) -W -Wall -Werror -I. $(DEFS) -lwsock32 -o $@.exe @@ -203,7 +179,7 @@ mongoose.h: $(HDRS) Makefile clean: clean_examples clean_embedded - rm -rf $(PROG) *.exe *.o *.dSYM *_test* ut fuzzer *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb slow-unit* _CL_* infer-out data.txt crash-* test/packed_fs.c pack arduino tmp + rm -rf $(PROG) *.exe *.o *.dSYM *_test* ut fuzzer *.gcov *.gcno *.gcda *.obj *.exe *.ilk *.pdb slow-unit* _CL_* infer-out data.txt crash-* test/packed_fs.c pack #find examples -maxdepth 3 -name zephyr -prune -o -name Makefile -print | xargs dirname | xargs -n1 make clean -C clean_embedded: diff --git a/examples/arduino/Makefile b/examples/arduino/Makefile new file mode 100644 index 00000000..db3f65e5 --- /dev/null +++ b/examples/arduino/Makefile @@ -0,0 +1,34 @@ +DOCKER ?= docker run --platform linux/amd64 --rm $(ENV) -v $(CWD):$(CWD) -w $(CWD) +CWD ?= $(realpath $(CURDIR)) + +all: +example: + true + +arduino: ENV = -v $(CWD):/root +arduino: + curl -sL http://downloads.arduino.cc/arduino-1.8.19-linux64.tar.xz | unxz | tar -xf - + mv arduino-* $@ + +arduino-xiao-board: + $(DOCKER) mdashnet/cc2 ./arduino/arduino --pref "boardsmanager.additional.urls=https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json" --save-prefs + $(DOCKER) mdashnet/cc2 ./arduino/arduino --pref "compiler.warning_level=all" --save-prefs + $(DOCKER) mdashnet/cc2 ./arduino/arduino --install-boards Seeeduino:samd + +arduino-xiao: ENV = -v $(CWD):/root +arduino-xiao: arduino arduino-xiao-board + rm -rf tmp; mkdir tmp + cp w5500/w5500.ino tmp/tmp.ino + cp ../../mongoose.[ch] w5500/mongoose_custom.h tmp/ + $(DOCKER) mdashnet/cc2 ./arduino/arduino --verbose --verify --board Seeeduino:samd:seeed_XIAO_m0 tmp/tmp.ino + +arduino-nano: ENV = -v $(CWD)/arduino:/root +arduino-nano: arduino + rm -rf tmp; mkdir tmp + cp w5500/w5500.ino tmp/tmp.ino + cp ../../mongoose.[ch] w5500/mongoose_custom.h tmp/ + $(DOCKER) mdashnet/cc2 ./arduino/arduino --verbose --verify --board arduino:avr:nano tmp/tmp.ino + +clean: + rm -rf arduino tmp +