Improve tests #140
Workflow file for this run
This file contains 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: Test | |
on: | |
push: | |
branches: | |
- main | |
tags-ignore: ["*"] | |
pull_request: | |
branches: ["*"] | |
workflow_dispatch: | |
inputs: | |
logLevel: | |
description: Log Level | |
default: info | |
type: choice | |
options: | |
- debug | |
- error | |
- fatal | |
- info | |
- panic | |
- warning | |
environment: | |
description: Environment | |
default: test | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- platform: linux/amd64 | |
dockerfile: Dockerfile.amd64-generic | |
tag: nntbn:amd64-generic | |
test: amd64-generic | |
- platform: linux/arm64 | |
dockerfile: Dockerfile.arm-neon | |
tag: nntbn:arm64 | |
test: arm-neon | |
- platform: linux/arm64 | |
dockerfile: Dockerfile.arm-cmsis-dsp | |
tag: nntbn:arm64 | |
test: arm-cmsis-dsp | |
- platform: linux/arm/v8 | |
dockerfile: Dockerfile.armv8-neon | |
tag: nntbn:armv8-neon | |
test: arm-neon | |
- platform: linux/arm/v7 | |
dockerfile: Dockerfile.armv7-neon | |
tag: nntbn:armv7-neon | |
test: arm-neon | |
steps: | |
- name: Docker Setup QEMU | |
uses: docker/[email protected] | |
with: | |
platforms: all | |
- name: Docker Setup Buildx | |
uses: docker/[email protected] | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Checkout submodules | |
run: git submodule update --init | |
- name: Create Buildx | |
run: | | |
docker buildx create --name tests --use | |
docker buildx inspect --bootstrap | |
- name: Build images | |
run: | | |
docker images | |
docker buildx build --platform ${{ matrix.platform }} -f scripts/docker/${{ matrix.dockerfile }} -t ${{ matrix.tag }} . --load | |
docker images | |
- name: Test | |
run: | | |
if [ "${{ matrix.test }}" == "arm-neon" ]; then | |
if [ "${{ matrix.tag }}" == "nntbn:armv7-neon" ]; then | |
TESTS="make test ARCH=arm FILTERS=neon LDFLAGS='-lm' CFLAGS='-mfpu=neon-vfpv4'" | |
else | |
TESTS="make test ARCH=arm FILTERS=neon LDFLAGS='-lm'" | |
fi | |
elif [ "${{ matrix.test }}" == "arm-cmsis-dsp" ]; then | |
TESTS="make test ARCH=arm FILTERS=cmsis-dsp LDFLAGS='-lm'" | |
elif [ "${{ matrix.test }}" == "amd64-generic" ]; then | |
TESTS="make test ARCH=generic LDFLAGS='-lm'" | |
else | |
echo "unknown test" | |
exit 1 | |
fi | |
IFS='|' read -ra TESTS <<< "$TESTS" | |
for TEST in "${TESTS[@]}"; do | |
echo "running ${TEST}" | |
docker run --platform ${{ matrix.platform }} ${{ matrix.tag }} "${TEST}" | |
echo " " | |
done |