fix: update timeout values in run_renode_tests.sh and change log leve… #339
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
| name: Build | |
| on: | |
| push: | |
| branches: [ master, main, develop] | |
| pull_request: | |
| branches: [ master, main, develop, feature/* ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-cmake: | |
| name: Build with CMake | |
| runs-on: ubuntu-latest | |
| container: | |
| image: chocotechnologies/dmboot:1.0.0 | |
| permissions: | |
| contents: read | |
| strategy: | |
| matrix: | |
| target: [STM32F407G, STM32F746xG, STM32F746ZG] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Git safe directories | |
| run: | | |
| echo "GITHUB_WORKSPACE: $GITHUB_WORKSPACE" | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE/lib/dmod" | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE/lib/dmlog" | |
| - name: Initialize and update submodules | |
| run: | | |
| git submodule init | |
| git submodule update --recursive | |
| - name: Verify submodules | |
| run: | | |
| git submodule status | |
| ls -la lib/ | |
| ls -la lib/dmod/ | |
| ls -la lib/dmod/configs/arch/armv7/cortex-m4/ | |
| - name: Verify toolchain installation | |
| run: | | |
| arm-none-eabi-gcc --version | |
| arm-none-eabi-objcopy --version | |
| arm-none-eabi-size --version | |
| cmake --version | |
| - name: Build dmod examples and create test DMP package | |
| run: | | |
| mkdir -p tests/data | |
| # Build dmod - first in SYSTEM mode to build tools (including todmp) | |
| cd lib/dmod | |
| mkdir -p build | |
| cd build | |
| cmake .. -DDMOD_MODE=DMOD_SYSTEM -DDMOD_TOOLS_NAME=arch/x86_64 | |
| cmake --build . | |
| # Now reconfigure to MODULE mode to build DMF files (reusing same build directory) | |
| cmake .. -DDMOD_MODE=DMOD_MODULE -DDMOD_TOOLS_NAME=arch/x86_64 | |
| cmake --build . | |
| # Create DMP package from DMF files using the todmp tool built earlier | |
| ./bin/tools/todmp test_startup ./dmf ./test_startup.dmp | |
| # Copy to tests/data directory | |
| cp test_startup.dmp ../../../tests/data/ | |
| cd ../../.. | |
| # Create test user data file | |
| echo "Test User Data Content" > tests/data/test_user_data.dat | |
| ls -lh tests/data/ | |
| # Verify the DMP file was created correctly | |
| lib/dmod/build/bin/tools/todmp -l tests/data/test_startup.dmp | |
| - name: Configure CMake for ${{ matrix.target }} | |
| run: | | |
| cmake -DCMAKE_BUILD_TYPE=Debug -DTARGET=${{ matrix.target }} -S . -B build | |
| - name: Build ${{ matrix.target }} with CMake (without embedded files) | |
| run: | | |
| cmake --build build --config Debug | |
| - name: Check output files (without embedded files) | |
| run: | | |
| ls -lh build/ | |
| file build/dmboot.elf | |
| if [ -f build/dmboot.map ]; then file build/dmboot.map; fi | |
| - name: Display memory usage (without embedded files) | |
| run: | | |
| arm-none-eabi-size build/dmboot.elf | |
| - name: Reconfigure CMake with embedded files | |
| run: | | |
| rm -rf build | |
| cmake -DCMAKE_BUILD_TYPE=Debug \ | |
| -DTARGET=${{ matrix.target }} \ | |
| -DSTARTUP_DMP_FILE=tests/data/test_startup.dmp \ | |
| -DUSER_DATA_FILE=tests/data/test_user_data.dat \ | |
| -S . -B build | |
| - name: Build ${{ matrix.target }} with CMake (with embedded files) | |
| run: | | |
| cmake --build build --config Debug | |
| - name: Verify embedded files in map | |
| run: | | |
| echo "Checking for embedded startup.dmp section..." | |
| grep -A 5 "\.embedded\.startup_dmp" build/dmboot.map || echo "startup_dmp section not found" | |
| echo "Checking for embedded user_data section..." | |
| grep -A 5 "\.embedded\.user_data" build/dmboot.map || echo "user_data section not found" | |
| echo "Checking for startup_dmp symbols..." | |
| grep "__startup_dmp" build/dmboot.map || echo "startup_dmp symbols not found" | |
| echo "Checking for user_data symbols..." | |
| grep "__user_data" build/dmboot.map || echo "user_data symbols not found" | |
| - name: Check output files (with embedded files) | |
| run: | | |
| ls -lh build/ | |
| file build/dmboot.elf | |
| if [ -f build/dmboot.map ]; then file build/dmboot.map; fi | |
| - name: Display memory usage (with embedded files) | |
| run: | | |
| arm-none-eabi-size build/dmboot.elf | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: cmake-${{ matrix.target }}-firmware | |
| path: | | |
| build/dmboot.elf | |
| build/dmboot.map | |
| retention-days: 30 | |
| test-renode: | |
| name: Test Renode Simulation | |
| runs-on: ubuntu-latest | |
| container: | |
| image: chocotechnologies/dmboot:1.0.0 | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up Git safe directories | |
| run: | | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE/lib/dmod" | |
| git config --global --add safe.directory "$GITHUB_WORKSPACE/lib/dmlog" | |
| - name: Initialize and update submodules | |
| run: | | |
| git submodule init | |
| git submodule update --recursive | |
| - name: Run Renode emulation tests | |
| run: | | |
| ./scripts/run_renode_tests.sh | |
| build-all: | |
| name: All builds completed | |
| runs-on: ubuntu-latest | |
| needs: [build-cmake, test-renode] | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: All targets built successfully | |
| run: echo "All targets built successfully with CMake!" |