Add defmt-avr checks (#94) #462
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-License-Identifier: Apache-2.0 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - 'feature/**' | |
| pull_request: | |
| name: Build and test | |
| jobs: | |
| check: | |
| name: Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Install stable toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run cargo check | |
| run: cargo check | |
| test: | |
| name: Tests | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Default configuration (int64 + float) | |
| - name: Default (int64 + float) | |
| features: "" | |
| # int8 configurations | |
| - name: int8 + float | |
| features: --no-default-features --features "int8,float" | |
| - name: int8 + float-skip | |
| features: --no-default-features --features "int8,float-skip" | |
| - name: int8 + float-error | |
| features: --no-default-features --features "int8,float-error" | |
| - name: int8 + float-truncate | |
| features: --no-default-features --features "int8,float-truncate" | |
| # int32 configurations | |
| - name: int32 + float | |
| features: --no-default-features --features "int32,float" | |
| - name: int32 + float-skip | |
| features: --no-default-features --features "int32,float-skip" | |
| - name: int32 + float-error | |
| features: --no-default-features --features "int32,float-error" | |
| - name: int32 + float-truncate | |
| features: --no-default-features --features "int32,float-truncate" | |
| # int64 configurations (beyond default) | |
| - name: int64 + float-skip | |
| features: --no-default-features --features "int64,float-skip" | |
| - name: int64 + float-error | |
| features: --no-default-features --features "int64,float-error" | |
| - name: int64 + float-truncate | |
| features: --no-default-features --features "int64,float-truncate" | |
| # defmt feature | |
| - name: defmt | |
| features: --features defmt | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| - name: Install stable toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Run cargo test | |
| working-directory: picojson | |
| run: cargo test ${{ matrix.features }} | |
| conformance-tests: | |
| name: JSONTestSuite Conformance Tests | |
| runs-on: ubuntu-latest | |
| continue-on-error: true # Don't fail the entire workflow if conformance tests fail to download or run | |
| steps: | |
| - name: Checkout sources | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive # Ensure conformance test submodule is downloaded | |
| - name: Install stable toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Verify conformance tests are available | |
| run: | | |
| if [ ! -d "picojson/tests/data/JSONTestSuite/test_parsing" ]; then | |
| echo "::warning::Conformance tests not available - skipping remote test validation" | |
| exit 0 | |
| fi | |
| echo "Found $(find picojson/tests/data/JSONTestSuite/test_parsing -name '*.json' | wc -l) conformance test files" | |
| - name: Run JSONTestSuite and JSON_checker conformance tests | |
| working-directory: picojson | |
| run: cargo test --features remote-tests | |
| continue-on-error: true | |
| - name: Report conformance test results | |
| run: echo "::notice::All conformance tests completed - check logs above for any failures" |