Skip to content

Commit d4223c6

Browse files
committed
ci(libseekdb): detect runner Python first, install if not usable; set OB_CCACHE in workflow
1 parent dc93cb6 commit d4223c6

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

.github/workflows/build-libseekdb.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,18 @@ jobs:
9393
${{ matrix.container_image }} \
9494
bash -c '
9595
set -e
96-
yum install -y git wget rpm cpio make glibc-devel glibc-headers binutils m4 python3 libtool libaio ncurses-devel which zlib-devel ccache 2>/dev/null || true
96+
yum install -y git wget rpm cpio make glibc-devel glibc-headers binutils m4 python3 python3-devel libtool libaio ncurses-devel which zlib-devel ccache 2>/dev/null || true
9797
git config --global --add safe.directory "$GITHUB_WORKSPACE"
9898
export PATH="$GITHUB_WORKSPACE/deps/3rd/usr/local/oceanbase/devtools/bin:$PATH"
9999
export CCACHE_DIR="$GITHUB_WORKSPACE/.ccache"
100+
export OB_CCACHE=$(which ccache)
100101
bash build.sh init
101-
PYVER=$(python3 -c "import sys; print(f\"{sys.version_info.major}.{sys.version_info.minor}\")")
102+
if [ -x /opt/python/cp39-cp39/bin/python3.9 ]; then
103+
export PATH="/opt/python/cp39-cp39/bin:$PATH"
104+
PYVER=3.9
105+
else
106+
PYVER=$(python3 -c "import sys; print(f\"{sys.version_info.major}.{sys.version_info.minor}\")")
107+
fi
102108
bash build.sh release --init -DOB_USE_CCACHE=ON -DBUILD_EMBED_MODE=ON -DPYTHON_VERSION=$PYVER
103109
cd build_release && make -j$(nproc) libseekdb
104110
cd package/libseekdb && bash libseekdb-build.sh "$GITHUB_WORKSPACE/build_release/src/include"
@@ -135,7 +141,7 @@ jobs:
135141
uses: actions/checkout@v4
136142

137143
- name: Install macOS dependencies
138-
run: brew install cmake dylibbundler googletest || true
144+
run: brew install cmake dylibbundler googletest ccache || true
139145

140146
- name: Cache deps (macOS)
141147
uses: actions/cache@v4
@@ -163,6 +169,7 @@ jobs:
163169
CMAKE_OSX_ARCHITECTURES: ${{ matrix.cmake_arch }}
164170
CCACHE_DIR: ${{ github.workspace }}/.ccache
165171
run: |
172+
export OB_CCACHE=$(which ccache)
166173
bash build.sh release --init -DOB_USE_CCACHE=ON -DBUILD_EMBED_MODE=ON -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake_arch }} -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0
167174
cd build_release && make -j$(sysctl -n hw.ncpu) libseekdb
168175

0 commit comments

Comments
 (0)