Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions .github/workflows/cmake-test-memory-riscv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
name: Test - All stk::memory (QEMU, RISC-V)

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
BUILD_TYPE: Release
GCC_VERSION: 15.2.0-1.1

jobs:
docker-build:
runs-on: ubuntu-22.04
name: "Build QEMU Docker image"

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Docker build
uses: docker/build-push-action@v5
with:
context: .
file: build/test/qemu/Dockerfile.riscv32
tags: stk-qemu-riscv:latest
load: false
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=docker,dest=/tmp/stk-qemu-riscv.tar

- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: stk-qemu-riscv-image
path: /tmp/stk-qemu-riscv.tar
retention-days: 1

build:
needs: docker-build
strategy:
fail-fast: false
matrix:
test:
- name: memory::BlockPool
cmake_flag: TEST_BLOCKPOOL=ON
elf: test-blockpool.elf
dir: blockpool

board:
- name: "Generic"
cmake_flags: -DTARGET_RV32I=ON
cpu: rv32
board: virt

runs-on: ubuntu-22.04

name: "${{matrix.test.name}} / ${{matrix.board.name}}"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Cache xPacks
id: cache-xpack
uses: actions/cache@v4
with:
path: ~/.local/xPacks
key: ${{ runner.os }}-xpack-riscv-${{ env.GCC_VERSION }}

- name: Install xPack RISC-V GCC
run: |
npm install --location=global xpm@latest
xpm install --global @xpack-dev-tools/riscv-none-elf-gcc@${{ env.GCC_VERSION }}
echo "$HOME/.local/xPacks/@xpack-dev-tools/riscv-none-elf-gcc/${{ env.GCC_VERSION }}/.content/bin" >> $GITHUB_PATH

- name: GCC version
run: riscv-none-elf-gcc --version

- name: Configure CMake
run: >
cmake -G "Unix Makefiles"
-B ${{github.workspace}}/build
-DCMAKE_TOOLCHAIN_FILE=build/cmake/toolchain/riscv-none-elf-gcc.cmake
${{matrix.board.cmake_flags}}
-DENABLE_LTO=ON
-DENABLE_SMALL=ON
-DBUILD_LIB=ON
-DBUILD_TESTS=ON
-DTEST_GENERIC=OFF
-D${{matrix.test.cmake_flag}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 4

- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: stk-qemu-riscv-image
path: /tmp

- name: Load Docker image
run: docker load --input /tmp/stk-qemu-riscv.tar

- name: Prepare
run: chmod +x build/test/qemu/stk-qemu.sh && chmod +x build/test/qemu/test.sh

- name: Test (${{matrix.test.name}})
run: >
sh build/test/qemu/test.sh
stk-qemu-riscv:latest
qemu-system-riscv32
${{matrix.board.cpu}}
${{matrix.board.board}}
${{github.workspace}}/build/test/${{matrix.test.dir}}
${{matrix.test.elf}}
114 changes: 114 additions & 0 deletions .github/workflows/cmake-test-memory-stm32.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
name: Test - All stk::memory (QEMU, Arm Cortex-M0,M4)

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
BUILD_TYPE: Release

jobs:
docker-build:
runs-on: ubuntu-22.04
name: "Build QEMU Docker image"

steps:
- name: Checkout
uses: actions/checkout@v6

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker build
uses: docker/build-push-action@v3
with:
context: .
file: build/test/qemu/Dockerfile.arm
tags: stk-qemu-arm:latest
load: false
cache-from: type=gha
cache-to: type=gha,mode=max
outputs: type=docker,dest=/tmp/stk-qemu-arm.tar

- name: Upload Docker image artifact
uses: actions/upload-artifact@v4
with:
name: stk-qemu-arm-image
path: /tmp/stk-qemu-arm.tar
retention-days: 1

build:
needs: docker-build
strategy:
fail-fast: false
matrix:
test:
- name: memory::BlockPool
cmake_flag: TEST_BLOCKPOOL=ON
elf: test-blockpool.elf
dir: blockpool

board:
- name: "STM32F0DISCOVERY"
cmake_flags: -DVENDOR_STM32=ON -DTARGET_CORTEX_M0=ON -DTARGET_CPU_FAMILY=STM32F051x8
cpu: cortex-m0
board: STM32F0-Discovery

- name: "STM32F407DISC1"
cmake_flags: -DVENDOR_STM32=ON -DTARGET_CORTEX_M4=ON -DTARGET_CPU_FAMILY=STM32F407xx
cpu: cortex-m4
board: STM32F4-Discovery

runs-on: ubuntu-22.04

name: "${{matrix.test.name}} / ${{matrix.board.name}}"

steps:
- name: Install GCC arm-none-eabi
uses: carlosperate/arm-none-eabi-gcc-action@v1

- name: GCC version
run: arm-none-eabi-gcc --version

- name: Checkout
uses: actions/checkout@v3

- name: Configure CMake
run: >
cmake -G "Unix Makefiles"
-B ${{github.workspace}}/build
-DCMAKE_TOOLCHAIN_FILE=build/cmake/toolchain/arm-none-eabi-gcc.cmake
${{matrix.board.cmake_flags}}
-DENABLE_LTO=ON
-DENABLE_SMALL=ON
-DBUILD_LIB=ON
-DBUILD_TESTS=ON
-DTEST_GENERIC=OFF
-D${{matrix.test.cmake_flag}}

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 4

- name: Download Docker image artifact
uses: actions/download-artifact@v4
with:
name: stk-qemu-arm-image
path: /tmp

- name: Load Docker image
run: docker load --input /tmp/stk-qemu-arm.tar

- name: Prepare
run: chmod +x build/test/qemu/stk-qemu.sh && chmod +x build/test/qemu/test.sh

- name: Test (${{matrix.test.name}})
run: >
sh build/test/qemu/test.sh
stk-qemu-arm:latest
qemu-system-gnuarmeclipse
${{matrix.board.cpu}}
${{matrix.board.board}}
${{github.workspace}}/build/test/${{matrix.test.dir}}
${{matrix.test.elf}}
5 changes: 5 additions & 0 deletions .github/workflows/cmake-test-sync-riscv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ jobs:
cmake_flag: TEST_CONDVAR=ON
elf: test-condvar.elf
dir: condvar

- name: sync::MessageQueue
cmake_flag: TEST_MSGQUEUE=ON
elf: test-msgqueue.elf
dir: msgqueue

board:
- name: "Generic"
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/cmake-test-sync-stm32.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ jobs:
cmake_flag: TEST_CONDVAR=ON
elf: test-condvar.elf
dir: condvar

- name: sync::MessageQueue
cmake_flag: TEST_MSGQUEUE=ON
elf: test-msgqueue.elf
dir: msgqueue

board:
- name: "STM32F0DISCOVERY"
Expand Down
Loading
Loading