Skip to content

Fix example_db.db error #50

Fix example_db.db error

Fix example_db.db error #50

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
defaults:
run:
shell: bash -l {0}
jobs:
test-unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04, macos-13, macos-14]
build_type: [static_build, shared_build]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
- name: Install micromamba
uses: mamba-org/setup-micromamba@v2
with:
environment-file: environment-dev.yml
- name: Make build directory
run: mkdir build
- name: Static build option
if: matrix.build_type == 'static_build'
run: |
CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DXSQL_BUILD_SHARED=OFF -DXSQL_USE_SHARED_XEUS_SQLITE=OFF"
echo "CMAKE_EXTRA_ARGS=$CMAKE_EXTRA_ARGS" >> $GITHUB_ENV
- name: Shared build option
if: matrix.build_type == 'shared_build'
run: |
CMAKE_EXTRA_ARGS="$CMAKE_EXTRA_ARGS -DXSQL_BUILD_STATIC=OFF"
echo "CMAKE_EXTRA_ARGS=$CMAKE_EXTRA_ARGS" >> $GITHUB_ENV
- name: Configure cmake
run: |
cmake .. \
-D CMAKE_PREFIX_PATH=$CONDA_PREFIX \
-D CMAKE_INSTALL_PREFIX=$CONDA_PREFIX \
-D XSQL_DOWNLOAD_GTEST=ON \
-D CMAKE_INSTALL_LIBDIR=lib \
-D CMAKE_C_COMPILER=$CC \
-D CMAKE_CXX_COMPILER=$CXX \
${{ env.CMAKE_EXTRA_ARGS }}
working-directory: build
- name: Install
run: make -j ${{ steps.cpu-cores.outputs.count }} install
working-directory: build
- name: Test xeus-sqlite (C++)
run: ./test_xeus_sqlite
working-directory: build/test
emscripten_wasm_build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
- name: Install micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: environment-wasm-build.yml
environment-name: xeus-sqlite-wasm-build
################################################################
# C++ build
################################################################
- name: Build
shell: bash -l {0}
run: |
micromamba create -f environment-wasm-host.yml --platform=emscripten-wasm32 --yes
mkdir build
pushd build
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-sqlite-wasm-host
export CMAKE_PREFIX_PATH=$PREFIX
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
emcmake cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
-Dtabulate_DIR=$PREFIX/lib/cmake/tabulate \
-DXSQL_BUILD_XSQLITE_EXECUTABLE=OFF \
-DXSQL_BUILD_SHARED=OFF \
-DXSQL_BUILD_STATIC=ON \
-DXSQL_USE_SHARED_XEUS=ON \
-DXSQL_USE_SHARED_XEUS_SQLITE=OFF \
-DXVEGA_STATIC_LIBRARY=$PREFIX/lib/libxvega.a \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
..
make -j${{ steps.cpu-cores.outputs.count }} install
################################################################
# jupyterlite page
################################################################
- name: Build jupyterlite page
shell: bash -l {0}
run: |
export PREFIX=$MAMBA_ROOT_PREFIX/envs/xeus-sqlite-wasm-host
# build jupyterlite
jupyter lite build \
--contents=examples \
--XeusAddon.prefix=$PREFIX
################################################################
# fix permissions
################################################################
- name: Fix permissions
run: |
chmod -c -R +rX "build_wasm/_output/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
################################################################
# upload to github pages
################################################################
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: _output
# Deploy job (only for the repo and **not** for forks)
deploy:
# only run on main branch
if: github.ref == 'refs/heads/main' && github.repository == 'jupyter-xeus/xeus-sqlite'
# Add a dependency to the build job
needs: emscripten_wasm_build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
contents: read # to read the Pages artifact
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Specify runner + deployment step
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action