test: generate the test set dynamically #181
Workflow file for this run
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: Action test | |
| on: | |
| push: | |
| pull_request: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| generate-matrix: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix: ${{ steps.set-matrix.outputs.matrix }} | |
| steps: | |
| - name: Generate dynamic matrix data | |
| id: set-matrix | |
| run: | | |
| RELEASE='["v3.7.0", "v4.0.0", "v4.1.0", "main"]' | |
| OS='["ubuntu-24.04", "ubuntu-24.04-arm", "macos-13", "macos-14", "macos-15", "windows-2022"]' | |
| MATRIX_JSON="{\"os\": $OS, \"release\": $RELEASE}" | |
| echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT | |
| build: | |
| needs: generate-matrix | |
| strategy: | |
| fail-fast: false | |
| matrix: ${{ fromJson(needs.generate-matrix.outputs.matrix) }} | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Main Zephyr repository checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: zephyrproject-rtos/zephyr | |
| path: zephyr | |
| ref: ${{ matrix.release }} | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.12 | |
| - name: Setup Zephyr project | |
| uses: ./ | |
| with: | |
| app-path: zephyr | |
| toolchains: arm-zephyr-eabi:riscv64-zephyr-elf:x86_64-zephyr-elf | |
| west-group-filter: -tools,-bootloader,-babblesim | |
| west-project-filter: -nrf_hw_models | |
| ccache-cache-key: ${{ matrix.os }}-${{ matrix.release }} | |
| - name: Build firmware | |
| working-directory: zephyr | |
| shell: bash | |
| run: | | |
| if [ "${{ runner.os }}" = "macOS" ]; then | |
| EXTRA_TWISTER_FLAGS="-P native_sim --build-only" | |
| elif [ "${{ runner.os }}" = "Windows" ]; then | |
| EXTRA_TWISTER_FLAGS="-P native_sim --short-build-path -O/tmp/twister-out" | |
| fi | |
| PLATFORMS_FLAGS="" | |
| if [ "${{ runner.os }}-${{ runner.arch }}" == "Linux-ARM64" ]; then | |
| PLATFORMS_FLAGS+="-p native_sim/native/64 " | |
| else | |
| PLATFORMS_FLAGS+="-p native_sim " | |
| fi | |
| PLATFORMS_FLAGS+="-p qemu_cortex_m0 " | |
| PLATFORMS_FLAGS+="-p qemu_cortex_r5 " | |
| PLATFORMS_FLAGS+="-p qemu_riscv32 " | |
| PLATFORMS_FLAGS+="-p qemu_riscv32e " | |
| PLATFORMS_FLAGS+="-p qemu_riscv64 " | |
| PLATFORMS_FLAGS+="-p qemu_x86 " | |
| PLATFORMS_FLAGS+="-p qemu_x86_64" | |
| ./scripts/twister --force-color --inline-logs -T samples/hello_world -v $PLATFORMS_FLAGS $EXTRA_TWISTER_FLAGS | |
| - name: Print ccache stats | |
| if: runner.os != 'Windows' | |
| run: | | |
| ccache -s -vv |