Skip to content

Commit dedb463

Browse files
authored
Add defmt-avr checks (#94)
* Add defmt-avr checks
1 parent 11a03e6 commit dedb463

3 files changed

Lines changed: 18 additions & 4 deletions

File tree

.github/workflows/avr_tests.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
run: python run_suite.py bloat
6969

7070
avr_panic_check:
71-
name: AVR Panic Prevention (${{ matrix.int_type }}, ${{ matrix.pico_size }}, ${{ matrix.profile }})
71+
name: AVR Panic Prevention (${{ matrix.int_type }}, ${{ matrix.pico_size }}, ${{ matrix.profile }}, defmt=${{ matrix.defmt }})
7272
runs-on: ubuntu-latest
7373
strategy:
7474
fail-fast: false
@@ -77,6 +77,7 @@ jobs:
7777
int_type: [int8, int32]
7878
profile: [release, dev]
7979
pico_size: [pico-tiny, pico-huge]
80+
defmt: [false, true]
8081
steps:
8182
- name: Checkout sources
8283
uses: actions/checkout@v4
@@ -117,14 +118,24 @@ jobs:
117118
cargo install cargo-binutils --locked
118119
fi
119120
121+
- name: Compose feature set
122+
id: feature_set
123+
shell: bash
124+
run: |
125+
FEATURES="${{ matrix.int_type }},${{ matrix.pico_size }}"
126+
if [ "${{ matrix.defmt }}" = "true" ]; then
127+
FEATURES="${FEATURES},defmt"
128+
fi
129+
echo "features=${FEATURES}" >> "$GITHUB_OUTPUT"
130+
120131
- name: Build the demos in ${{ matrix.profile }} mode
121132
working-directory: avr_demo
122-
run: cargo build --example ${{ matrix.example }} --profile ${{ matrix.profile }} --no-default-features --features "${{ matrix.int_type }},${{ matrix.pico_size }}"
133+
run: cargo build --example ${{ matrix.example }} --profile ${{ matrix.profile }} --no-default-features --features "${{ steps.feature_set.outputs.features }}"
123134

124135
- name: Check for panics ( minimal )
125136
working-directory: avr_demo
126-
run: cargo nm --example minimal --profile ${{ matrix.profile }} --no-default-features --features "${{ matrix.int_type }},${{ matrix.pico_size }}" | ( ! egrep "panic|unwind" )
137+
run: cargo nm --example minimal --profile ${{ matrix.profile }} --no-default-features --features "${{ steps.feature_set.outputs.features }}" | ( ! egrep "panic|unwind" )
127138

128139
- name: Check for panics
129140
working-directory: avr_demo
130-
run: cargo nm --example ${{ matrix.example }} --profile ${{ matrix.profile }} --no-default-features --features "${{ matrix.int_type }},${{ matrix.pico_size }}" | ( ! egrep "panic|unwind" )
141+
run: cargo nm --example ${{ matrix.example }} --profile ${{ matrix.profile }} --no-default-features --features "${{ steps.feature_set.outputs.features }}" | ( ! egrep "panic|unwind" )

avr_demo/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ default = ["depth-7", "pico-tiny", "ufmt", "int8"]
4545

4646
int8 = [ "picojson/int8"]
4747
int32 = [ "picojson/int32"]
48+
defmt = ["picojson/defmt"]
4849

4950
depth-7 = []
5051
depth-9 = []

avr_demo/run_suite.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ def get_depths_from_build_rs():
3131
CONFIGS = [
3232
("serde", "test_serde", ["ufmt","int8"]),
3333
("slice-tiny", "test_picojson", ["pico-tiny","ufmt", "int8"]),
34+
("slice-tiny-defmt", "test_picojson", ["pico-tiny","ufmt", "int8", "defmt"]),
3435
("slice-small", "test_picojson", ["pico-small","ufmt" , "int8"]),
3536
("slice-huge", "test_picojson", ["pico-huge","ufmt", "int8"]),
3637
("stream-tiny", "test_streamparser", ["pico-tiny","ufmt", "int8"]),
38+
("stream-tiny-defmt", "test_streamparser", ["pico-tiny","ufmt", "int8", "defmt"]),
3739
("stream-small", "test_streamparser", ["pico-small","ufmt", "int8"]),
3840
("stream-huge", "test_streamparser", ["pico-huge","ufmt", "int8"]),
3941
]

0 commit comments

Comments
 (0)