Skip to content

Commit

Permalink
update ci to upload both release and debug bin firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Dec 21, 2023
1 parent 88dac12 commit 320ad46
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions main/sketch.ino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 320ad46

Please sign in to comment.