Skip to content

Commit cab001e

Browse files
committed
Add GitHub script to build python module
Manually triggered script which uploads the artifact.
1 parent ab11924 commit cab001e

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Build extras/analyze
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
python-version:
7+
description: 'Python version to use'
8+
required: true
9+
default: '3.8-dev'
10+
ref:
11+
description: 'The OptSched git ref to checkout to build'
12+
required: true
13+
default: 'master'
14+
build_type:
15+
description: 'CMAKE_BUILD_TYPE'
16+
required: true
17+
default: 'Release'
18+
19+
jobs:
20+
build:
21+
runs-on: ubuntu-20.04
22+
23+
steps:
24+
- name: Install APT dependencies
25+
run: |
26+
# For parallel STL
27+
sudo apt-get install libtbb-dev
28+
29+
# For latest C++ features
30+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
31+
sudo apt-get update
32+
33+
sudo apt-get install g++-11
34+
35+
# For pyenv python
36+
sudo apt-get install make build-essential libssl-dev zlib1g-dev \
37+
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
38+
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
39+
40+
- name: Install Python version
41+
run: |
42+
curl https://pyenv.run | bash
43+
eval "$(pyenv init --path)"
44+
echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV
45+
echo "$HOME/.pyenv/bin" >> $GITHUB_PATH
46+
47+
export PYENV_ROOT="$HOME/.pyenv"
48+
export PATH="$PYENV_ROOT/bin:$PATH"
49+
50+
pyenv install ${{ github.event.inputs.python-version }}
51+
pyenv global ${{ github.event.inputs.python-version }}
52+
53+
python3 --version
54+
55+
- uses: actions/checkout@v2
56+
with:
57+
ref: ${{ github.event.inputs.ref }}
58+
59+
- name: Configure
60+
run: |
61+
eval "$(pyenv init --path)"
62+
63+
cmake -S extras/analyze -B build \
64+
-DCMAKE_BUILD_TYPE=${{ github.event.inputs.build_type }} \
65+
-DPython_FIND_UNVERSIONED_NAMES=FIRST \
66+
-DPYBIND11_FINDPYTHON=ON \
67+
-DCMAKE_CXX_COMPILER=g++-11
68+
69+
- name: Build
70+
run: |
71+
eval "$(pyenv init --path)"
72+
73+
cmake --build build -j 2
74+
75+
- name: Upload Artifact
76+
uses: actions/upload-artifact@v2
77+
with:
78+
name: Python-${{ github.event.inputs.python-version }} ${{ github.event.inputs.build_type }} Module
79+
path: build/eventanalyze.*.so
80+
if-no-files-found: error

0 commit comments

Comments
 (0)