Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.
name: Bestla Unit Test
on:
pull_request:
branches: [main]
paths:
- bestla/**"
- .github/workflows/unit-test-bestla.yml
- '!bestla/README.md'
workflow_dispatch:
inputs:
compiler_version:
description: 'compiler_version'
required: false
type: string
default: '13.1.0'
# If there is a new commit, the previous jobs will be canceled
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
INPUT_COMPILER_VERSION: ${{ inputs.compiler_version || '13.1.0' }}
WORKING_DIR: ${{ github.workspace }}
jobs:
unit-test:
runs-on: [self-hosted, linux, X64, spr]
steps:
- name: Checkout out Repo
uses: actions/checkout@v3
with:
submodules: "recursive"
fetch-tags: true
- name: Env build
- name: Run UT
run: |
conda deactivate
source /opt/rh/gcc-toolset-12/enable
cd ${{ github.workspace }}/bestla && mkdir build && cd build && cmake .. -DBTLA_UT_ALL=ON && make -j
./bestla_ut 2>&1 | tee unit_test_bestla.log
- name: Check Result
run: |
if [[ $(grep -c "Case Failed" ${{ github.workspace }}/bestla/build/unit_test_bestla.log) != 0 ]]; then
echo "UT Failed! Please check UT log."
exit 1
fi
- name: Publish pipeline artifact
uses: actions/upload-artifact@v3
if: ${{ !cancelled() }}
with:
name: Bestla Unit Test
path: ${{ github.workspace }}/bestla/build/unit_test*.*