Skip to content

Merge pull request #150 from Peefy/kcl-go-lib-home #90

Merge pull request #150 from Peefy/kcl-go-lib-home

Merge pull request #150 from Peefy/kcl-go-lib-home #90

Workflow file for this run

name: cpp-test
on:
push:
branches:
- main
- master
tags:
- '*'
pull_request:
branches:
- main
paths:
- "cpp/**"
- ".github/workflows/cpp-test.yaml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build-and-test:
defaults:
run:
working-directory: "cpp"
strategy:
matrix:
os: [macos-12, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install dependencies
if: "contains(matrix.os, 'ubuntu-latest')"
run: |
sudo apt-get update
sudo apt-get install libgtest-dev ninja-build
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: 1.79
override: true
components: clippy, rustfmt
- name: Build
run: |
# Set cargo build target on macos
export MACOSX_DEPLOYMENT_TARGET=12.0
mkdir build
cd build
cmake ..
make -j8
- name: Run Examples
shell: bash
run: |
cd build
for file in ./*
do
if [[ -f "$file" && -x "$file" ]]; then
echo "Executing: $file"
if ! "$file"; then
echo "Error occurred while executing $file. Exiting script."
exit 1
fi
fi
done