Skip to content

added build and test workflows #60

added build and test workflows

added build and test workflows #60

Workflow file for this run

name: CMake Build
on:
pull_request:
types: [opened, synchronize]
branches: main-ge
workflow_dispatch:
# see binary-caching-github-actions-cache
env:
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout AIEBU
uses: actions/checkout@v4
with:
submodules: recursive
# See binary caching with github actions
- name: Export GitHub Actions cache environment variables
uses: actions/github-script@v7
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Install Dependencies (Linux) and configure CMake
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libelf-dev libboost-dev pylint elfutils
python -m pip install --upgrade pip
pip install pyyaml jinja2 Markdown pylint colorama gitPython wrapt
cmake -B ${{github.workspace}}/build/Release \
-DAIEBU_FULL=ON \
-DCMAKE_BUILD_TYPE=Release
- name: Save Python Path for ise with CMake
if: runner.os == 'Windows'
run: |
$python_path = (Get-Command python3).path
echo "PYTHON_EXECUTABLE=$python_path"
echo "PYTHON_EXECUTABLE=$python_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Install Dependencies (Windows) and configure CMake
if: runner.os == 'Windows'
run: |
vcpkg integrate install
vcpkg install boost-format boost-uuid boost-interprocess boost-algorithm boost-property-tree boost-headers --triplet=x64-windows
# install python dependencies
python -m pip install --upgrade pip
python -m pip install pyyaml jinja2 Markdown pylint colorama gitPython wrapt
# configure cmake specifying path to python
cmake -B ${{github.workspace}}/build/Release `
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake `
-DAIEBU_FULL=ON `
-DCMAKE_BUILD_TYPE=Release `
-DPython3_EXECUTABLE=${{ env.PYTHON_EXECUTABLE }}
- name: Build
run: |
cmake --build ${{github.workspace}}/build/Release --config Release
cmake --build ${{github.workspace}}/build/Release --target install
- name: Test (Linux)
if: runner.os == 'Linux'
run: |
cmake --build ${{github.workspace}}/build/Release --config Release --target test
- name: Test (Windows)
if: runner.os == 'Windows'
run: |
cmake --build ${{github.workspace}}/build/Release --config Release --target run_tests