llama-cpp-turboquant/.github/workflows/cpp_examples.yml
Alejandro Saucedo a434e0a791
Added initial example for automated CI
Signed-off-by: Alejandro Saucedo <axsauze@gmail.com>
2022-11-26 16:10:45 +00:00

43 lines
1.4 KiB
YAML

name: C++ Tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
array-multiplication-example:
runs-on: ubuntu-latest
container: axsauze/kompute-builder:0.4
env:
VK_ICD_FILENAMES: "/swiftshader/vk_swiftshader_icd.json"
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: false
- name: "[Release g++] Build & Test"
uses: KomputeProject/action-cmake-build@master
with:
build-dir: ${{github.workspace}}/examples/array_multiplication/build
source-dir: ${{github.workspace}}/examples/array_multiplication
cc: gcc
cxx: g++
build-type: Debug
run-test: false
ctest-options: -V
configure-options: -DKOMPUTE_OPT_USE_BUILT_IN_VULKAN_HEADER=ON KOMPUTE_OPT_FROM_SOURCE=ON
build-options: --parallel # Given we don't build too many resources we can leverage parallel
- name: Run tests
run: |
# Check that the expected output is printed
TEST_STDOUT=$(./examples/array_multiplication/build/src/kompute_array_mult)
echo "$TEST_STDOUT"
TEST_CODE=$?
echo "Exit value for test run: $TEST_CODE"
echo $TEST_STDOUT | grep -q "Output: { 0 4 12 }"
TEST_MATCH=$?
echo "Exit value for text match: $TEST_MATCH"
exit $(($TEST_CODE + $TEST_MATCH))