From 320ad469bbf2b19e11f9794614ace3a3ef79573f Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 21 Dec 2023 23:14:48 +0700 Subject: [PATCH] update ci to upload both release and debug bin firmware --- .github/workflows/build.yml | 19 ++++++++++++++++--- Makefile | 6 ++++++ main/sketch.ino.cpp | 4 ++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d3368d1..949a5a6f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,12 @@ concurrency: jobs: build: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + config: + - 'release' + - 'debug' steps: - name: Setup Python uses: actions/setup-python@v4 @@ -26,24 +32,31 @@ jobs: run: docker pull espressif/idf:v3.3.1 - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout submodules run: git submodule update --init --depth 1 certificates - name: Build + if: matrix.config == 'release' run: docker run --rm -v $PWD:/project -w /project espressif/idf:v3.3.1 make firmware + - name: Build for Debug + if: matrix.config == 'debug' + run: | + docker run --rm -v $PWD:/project -w /project espressif/idf:v3.3.1 make NINA_DEBUG=1 firmware + mv NINA_W102*.bin "$(echo NINA_W102*.bin | sed 's/.bin/_debug.bin/')" + - name: Upload Artifacts uses: actions/upload-artifact@v3 with: - name: NINA_W102-${{ github.sha }} + name: NINA_W102-${{ matrix.config }}-${{ github.sha }} path: | NINA_W102*.bin - name: Upload Release Asset uses: softprops/action-gh-release@v1 - if: ${{ github.event_name == 'release' }} + if: ${{ github.event_name == 'release' }} && matrix.config == 'release' with: files: | NINA_W102*.bin diff --git a/Makefile b/Makefile index 37a87f30..6c932dc2 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,12 @@ CFLAGS += -DNDEBUG -DCONFIG_FREERTOS_ASSERT_DISABLE -Os -DLOG_LOCAL_LEVEL=0 CPPFLAGS += -DNDEBUG -Os endif +NINA_DEBUG ?= 0 +ifeq ($(NINA_DEBUG),1) +CFLAGS += -DNINA_DEBUG +CPPFLAGS += -DNINA_DEBUG +endif + ifeq ($(UNO_WIFI_REV2),1) CFLAGS += -DUNO_WIFI_REV2 CPPFLAGS += -DUNO_WIFI_REV2 diff --git a/main/sketch.ino.cpp b/main/sketch.ino.cpp index 0b05c0dd..7bc429b0 100644 --- a/main/sketch.ino.cpp +++ b/main/sketch.ino.cpp @@ -42,7 +42,11 @@ extern "C" { #define SPI_BUFFER_LEN SPI_MAX_DMA_LEN +#ifdef NINA_DEBUG +int debug = 1; +#else int debug = 0; +#endif uint8_t* commandBuffer; uint8_t* responseBuffer;