Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
name: CMake on a single platform
name: CMake Linux

on:
push:
Expand Down Expand Up @@ -30,17 +28,18 @@ jobs:
- name: Install libs
run: |
sudo apt-get update -qq
sudo apt-get install sqlite3 -y
sudo apt-get install sqlite3 libsqlite3-dev -y
sudo apt-get install cmake -y
sudo apt-get install gcc -y
sudo apt-get install python3 -y
sudo apt-get install luajit -y
sudo apt-get install libluajit-5.1-dev -y


- 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}}
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSQLITE_PLUGIN_LJ_PORTABLE_RPATH=ON

- name: Build
# Build your program with the given configuration
Expand All @@ -52,7 +51,8 @@ jobs:
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}} -V

- uses: actions/upload-artifact@v4.3.3
- if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4.3.3
with:
name: sqlite_plugin_lj_src
path: |
Expand All @@ -64,11 +64,11 @@ jobs:
${{github.workspace}}/DockerAlpine
${{github.workspace}}/DockerUbuntu
${{github.workspace}}/README.md
${{github.workspace}}/test.sh
${{github.workspace}}/test.py

- uses: actions/upload-artifact@v4.3.3
- if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4.3.3
with:
name: sqlite_plugin_lj_lib
path: ${{github.workspace}}/build/libsqlite_plugin_lj.so


56 changes: 56 additions & 0 deletions .github/workflows/cmake-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: CMake on macOS

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
BUILD_TYPE: Release

jobs:
build-macos:
runs-on: macos-latest

steps:
- name: Ensure Node.js for JS-based actions
run: |
if ! command -v node >/dev/null 2>&1; then
brew update
brew install node
fi
node --version

- uses: actions/checkout@v4

- name: Install dependencies
run: |
brew update
brew install cmake sqlite luajit python

- name: Configure environment
run: |
SQLITE_PREFIX="$(brew --prefix sqlite)"
LUAJIT_PREFIX="$(brew --prefix luajit)"
echo "SQLITE3_INCLUDE_DIR=${SQLITE_PREFIX}/include" >> "$GITHUB_ENV"
echo "SQLITE3_BIN=${SQLITE_PREFIX}/bin/sqlite3" >> "$GITHUB_ENV"
echo "LUAJIT_INCLUDE_DIR=${LUAJIT_PREFIX}/include/luajit-2.1" >> "$GITHUB_ENV"
echo "LUAJIT_LIBRARY=${LUAJIT_PREFIX}/lib/libluajit-5.1.dylib" >> "$GITHUB_ENV"
echo "LUAJIT_BIN=${LUAJIT_PREFIX}/bin/luajit" >> "$GITHUB_ENV"

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSQLITE_PLUGIN_LJ_PORTABLE_RPATH=ON

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} -V

- if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4.3.3
with:
name: sqlite_plugin_lj_lib_macos
path: ${{github.workspace}}/build/libsqlite_plugin_lj.dylib
94 changes: 94 additions & 0 deletions .github/workflows/cmake-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: CMake on Windows

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
BUILD_TYPE: Release
VCPKG_ROOT: C:\vcpkg

jobs:
build-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4

- name: Ensure Python is available
shell: cmd
run: |
where python >nul 2>nul && (python --version && exit /b 0)
where py >nul 2>nul && (py -3 --version && exit /b 0)
echo Python 3 is required on the runner but was not found in PATH.
exit /b 1

- name: Install SQLite headers with vcpkg
shell: cmd
run: |
if not exist "%VCPKG_ROOT%" git clone https://github.com/microsoft/vcpkg "%VCPKG_ROOT%"
call "%VCPKG_ROOT%\bootstrap-vcpkg.bat"
"%VCPKG_ROOT%\vcpkg.exe" install sqlite3:x64-windows

- name: Install sqlite3 CLI
shell: cmd
run: |
set "SQLITE_URL=https://sqlite.org/2026/sqlite-tools-win-x64-3510200.zip"
set "SQLITE_ZIP=%RUNNER_TEMP%\sqlite-tools.zip"
set "SQLITE_DIR=%RUNNER_TEMP%\sqlite-tools"
if not exist "%SQLITE_DIR%" mkdir "%SQLITE_DIR%"
curl -L "%SQLITE_URL%" -o "%SQLITE_ZIP%"
tar -xf "%SQLITE_ZIP%" -C "%SQLITE_DIR%"
set "SQLITE_EXE_DIR="
for /r "%SQLITE_DIR%" %%F in (sqlite3.exe) do (
set "SQLITE_EXE_DIR=%%~dpF"
goto :found_sqlite
)
echo sqlite3.exe not found after extracting sqlite-tools archive
exit /b 1
:found_sqlite
echo %SQLITE_EXE_DIR%>>"%GITHUB_PATH%"
"%SQLITE_EXE_DIR%sqlite3.exe" --version

- name: Configure CMake (MSVC)
shell: cmd
run: >
cmake -S . -B build -G "Visual Studio 17 2022" -A x64
-DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake
-DVCPKG_TARGET_TRIPLET=x64-windows

- name: Build
shell: cmd
run: cmake --build build --config %BUILD_TYPE%

- name: Test
shell: cmd
run: ctest --test-dir build -C %BUILD_TYPE% -V

- name: Upload source artifact
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4.3.3
with:
name: sqlite_plugin_lj_src_windows
path: |
${{ github.workspace }}/expected
${{ github.workspace }}/sql
${{ github.workspace }}/src
${{ github.workspace }}/LICENSE
${{ github.workspace }}/CMakeLists.txt
${{ github.workspace }}/DockerAlpine
${{ github.workspace }}/DockerUbuntu
${{ github.workspace }}/README.md
${{ github.workspace }}/test.py

- name: Upload windows build artifacts
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4.3.3
with:
name: sqlite_plugin_lj_windows
path: |
${{ github.workspace }}/build/Release/*sqlite_plugin_lj*.dll
${{ github.workspace }}/build/Release/*sqlite_plugin_lj*.lib
${{ github.workspace }}/build/libsqlite_plugin_lj.dll
27 changes: 27 additions & 0 deletions .github/workflows/docker-alpine.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Alpine Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-docker-alpine:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build DockerAlpine binaries target
run: |
rm -rf lib
mkdir -p lib
docker build --output=lib --target=binaries -f DockerAlpine .
test -f lib/libsqlite_plugin_lj.so

- if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4.3.3
with:
name: sqlite_plugin_lj_lib_alpine_docker
path: lib/libsqlite_plugin_lj.so
27 changes: 27 additions & 0 deletions .github/workflows/docker-ubuntu.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docker Ubuntu Build

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build-docker-ubuntu:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Build DockerUbuntu binaries target
run: |
rm -rf lib
mkdir -p lib
docker build --output=lib --target=binaries -f DockerUbuntu .
test -f lib/libsqlite_plugin_lj.so

- if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v4.3.3
with:
name: sqlite_plugin_lj_lib_ubuntu_docker
path: lib/libsqlite_plugin_lj.so
Loading
Loading