Skip to content

update py netlist api #357

update py netlist api

update py netlist api #357

name: snl_python_app
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
NAJA_INSTALL: ${{github.workspace}}/naja_install
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: Install boost & capnproto
# install dependencies
run: sudo apt-get update && sudo apt-get install -yq libboost-dev libfl-dev capnproto libcapnp-dev libtbb-dev
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.NAJA_INSTALL}}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build -j 4 --config ${{env.BUILD_TYPE}}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -VV -C ${{env.BUILD_TYPE}}
- name: CreateDirs and copy script
run: |
mkdir -p ${{env.NAJA_INSTALL}}
mkdir -p ${{github.workspace}}/snlpythonapp
- name: Copy Python app
working-directory: ${{github.workspace}}/snlpythonapp
run: |
cp ${{github.workspace}}/src/snl/snippets/python/snl_snippet.py .
- name: Install
working-directory: ${{github.workspace}}/build
run: make install
- name: ExecutePythonSnippetApp
working-directory: ${{github.workspace}}/snlpythonapp
env:
LD_LIBRARY_PATH: ${{env.LD_LIBRARY_PATH}}:${{env.NAJA_INSTALL}}/lib
PYTHONPATH: ${{env.PYTHONPATH}}:${{env.NAJA_INSTALL}}/lib/python
run: python3 snl_snippet.py