Skip to content

Commit 2b123b9

Browse files
author
Diego Jesus
committed
Simplify and move build script to own file
1 parent 4321e78 commit 2b123b9

File tree

3 files changed

+50
-38
lines changed

3 files changed

+50
-38
lines changed

.github/workflows/build.yaml

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -12,59 +12,29 @@ jobs:
1212
- {
1313
name: "Ubuntu-gcc",
1414
os: ubuntu-latest,
15-
set_path: "export PATH=$PATH:/home/runner/.local/bin",
16-
conan_profile: './tools/profiles/ubuntu_gcc_Release_gh.txt',
17-
cc: "gcc-9",
18-
cxx: "g++-9"
15+
OS: "ubuntu",
16+
compiler: "gcc"
1917
}
2018
- {
2119
name: "macOs-clang",
2220
os: macos-latest,
23-
set_path: "",
24-
conan_profile: './tools/profiles/macos_clang_Release_gh.txt',
25-
cc: "clang",
26-
cxx: "clang++"
21+
OS: "macos",
22+
compiler: "clang"
2723
}
2824
- {
2925
name: "Windows-msvc",
3026
os: windows-2019,
31-
set_path: "",
32-
conan_profile: './tools/profiles/win_msvc_Release_gh.txt',
33-
cc: "",
34-
cxx: ""
27+
OS: "win",
28+
compiler: "msvc"
3529
}
3630
steps:
3731
- name: Check out repository
3832
uses: actions/checkout@v3
3933
with:
4034
path: 'pagoda'
4135

42-
- name: Download and Install Dependencies
43-
run: |
44-
python3 -m venv ${{ github.workspace }}/build_env
45-
source ${{ github.workspace }}/build_env/bin/activate
46-
pip3 install wheel setuptools numpy
47-
pip3 install -r ${{ github.workspace }}/pagoda/requirements.txt
48-
49-
- name: Download and Install Dependencies (Ubuntu)
50-
if: ${{ contains(matrix.config.os, 'Ubuntu') }}
51-
run: |
52-
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev build-essential
53-
54-
- name: Configure and Build
55-
env:
56-
CC: ${{ matrix.config.cc }}
57-
CXX: ${{ matrix.config.cxx }}
58-
CONAN_SYSREQUIRES_MODE: "enabled"
59-
run: |
60-
source ${{ github.workspace }}/build_env/bin/activate
61-
${{ matrix.config.set_path }}
62-
pushd ${{ github.workspace }}/pagoda
63-
git submodule update --init --recursive
64-
conan install --profile:build=${{ github.workspace}}/pagoda/${{ matrix.config.conan_profile }} --profile:host=${{ github.workspace}}/pagoda/${{ matrix.config.conan_profile }} -of ${{ github.workspace }}/build ${{ github.workspace }}/pagoda --build=missing
65-
cmake --preset conan-release
66-
cmake --build ${{ github.workspace }}/build -j 24
67-
popd
36+
- name: Build
37+
run: ${{ github.workspace }}/pagoda/build.sh ${{ github.workspace }} ${{ matrix.config.OS }} ${{ matrix.config.compiler }}
6838

6939
- name: Run tests
7040
run: |

build.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/sh
2+
3+
WORKSPACE=${1}
4+
OS=${2}
5+
COMPILER=${3}
6+
7+
PY_VENV=${WORKSPACE}/buildenv
8+
PAGODA_ROOT=${WORKSPACE}/pagoda
9+
10+
PAGODA_ROOT=${WORKSPACE}/pagoda
11+
CONAN_PROFILE_ROOT=${PAGODA_ROOT}/tools/profiles/
12+
CONAN_PROFILE=${CONAN_PROFILE_ROOT}/${OS}_${COMPILER}_Release_gh.txt
13+
14+
#----------------------------------------
15+
# install dependencies
16+
#----------------------------------------
17+
python3 -m venv ${PY_VENV}
18+
source ${PY_VENV}/bin/activate
19+
pip3 install wheel setuptools numpy
20+
pip3 install -r ${WORKSPACE}/pagoda/requirements.txt
21+
22+
#----------------------------------------
23+
# install conan dependencies
24+
#----------------------------------------
25+
pushd ${WORKSPACE}/pagoda
26+
git submodule update --init --recursive
27+
conan install \
28+
--profile:build=${WORKSPACE}/pagoda/${CONAN_PROFILE} \
29+
--profile:host=${WORKSPACE}/pagoda/${CONAN_PROFILE} \
30+
-of ${WORKSPACE}/build \
31+
${WORKSPACE}/pagoda \
32+
--build=missing
33+
34+
#----------------------------------------
35+
# Build Pagoda
36+
#----------------------------------------
37+
cmake --preset conan-release
38+
cmake --build ${WORKSPACE}/build -j 24
39+
popd

requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1+
wheel
2+
setuptools
3+
numpy
14
conan==2.6.0
25
cmake==3.30.2

0 commit comments

Comments
 (0)