Skip to content

UnitTest

UnitTest #21

Workflow file for this run

name: UnitTest
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
env:
BUILD_TYPE: Release
jobs:
# Build and run UnitTests in the host machine
host-native-build-run:
#runs-on: [self-hosted, linux, x64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# Redis is nedded to run the Message Broker's UnitTests
- id: setup-redis
uses: shogo82148/actions-setup-redis@v1
# TODO: Use a GitHub API or a GitHub Action to retrieve the latest release
- name: Download native SDK
run: wget https://github.com/SCVready/presenceos-repo/releases/download/v1.0/presenceos_1.0_native_sdk.tar -q
- name: Extract native SDK
run: tar -xvf presenceos_1.0_native_sdk.tar
- name: Install native SDK
run: |
./poky-glibc-x86_64-presenceos-core2-32-toolchain-2.6.4.sh -y -d ./native_sdk
sed -i '/^export \([CC CXX CPP]\)/ s/--sysroot=$SDKTARGETSYSROOT/-Wl,-rpath=$SDKTARGETSYSROOT\/lib:$SDKTARGETSYSROOT\/usr\/lib,-dynamic-linker $SDKTARGETSYSROOT\/lib\/ld-linux.so.2/g' native_sdk/environment-setup-core2-32-poky-linux
- name: Build and run tests
working-directory: ${{github.workspace}}
run: ./test/build_ut.sh -b build_native -s native_sdk -r -u ${{ steps.setup-redis.outputs.redis-unix-socket }}
# Cross build UnitTests in the host machine for the target machine
host-cross-build:
#runs-on: [self-hosted, linux, x64]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# TODO: Use a GitHub API or a GitHub Action to retrieve the latest release
- name: Download cross SDK
run: wget https://github.com/SCVready/presenceos-repo/releases/download/v1.0/presenceos_1.0_sdk.tar -q
- name: Extract cross SDK
run: tar -xvf presenceos_1.0_sdk.tar
- name: Install cross SDK
run: ./poky-glibc-x86_64-presenceos-cortexa7t2hf-neon-vfpv4-toolchain-2.6.4.sh -y -d ./sdk
- name: Build tests
working-directory: ${{github.workspace}}
run: ./test/build_ut.sh -b build -s sdk