Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
23b808a
feat(workflow): add musl build for alpine container
Gioee Aug 7, 2025
85f4b16
feat(workflow): add musl arm64 builds
Gioee Aug 7, 2025
121d4a5
fix(workflow): update ARM architecture OS to ubuntu-24.04-arm in buil…
Gioee Aug 7, 2025
af552e0
fix(workflow): adjust build steps for musl target in CI workflow
Gioee Aug 7, 2025
46ff873
fix(workflow): adjust shell usage for musl builds in CI workflow
Gioee Aug 7, 2025
f39022e
feat(workflow): add install build dependencies for musl
Gioee Aug 7, 2025
42eeb1e
feat(workflow): add curl to build dependencies for musl
Gioee Aug 7, 2025
1d3d0cd
feat(workflow): add openssl-dev to build dependencies for musl
Gioee Aug 7, 2025
baa8763
feat(workflow): enable musl test
Gioee Aug 7, 2025
784ef38
feat(workflow): add git clone step for musl arm64 builds
Gioee Aug 7, 2025
7fce877
feat(workflow): add sqlite to build dependencies for musl
Gioee Aug 7, 2025
607b57a
fix(workflow): update condition for checkout step and git clone for m…
Gioee Aug 7, 2025
6e2b564
fix(workflow): add safe.directory configuration for musl arm64 git clone
Gioee Aug 7, 2025
248d938
fix(workflow): add diagnostic commands for gcc and make in musl arm64…
Gioee Aug 7, 2025
d36c577
fix(workflow): remove diagnostic commands for gcc and make from musl …
Gioee Aug 7, 2025
483c656
fix(workflow): update safe.directory configuration for musl arm64 git…
Gioee Aug 7, 2025
f26d950
fix(workflow): rename musl arm64 git clone step and remove unnecessar…
Gioee Aug 7, 2025
129172e
fix(workflow): remove unnecessary build dependencies for linux-musl a…
Gioee Aug 7, 2025
0abba64
fix(workflow): streamline installation of build dependencies for linu…
Gioee Aug 7, 2025
aa54c07
fix(workflow): move linux-musl configurations
Gioee Aug 7, 2025
309f44e
fix(workflow): update linux-musl job configurations for arm64 and x86_64
Gioee Aug 7, 2025
b040a7b
fix(workflow): add musl-gcc as compiler for linux-musl arm64 job
Gioee Aug 7, 2025
c6e1187
fix(workflow): update shell command for linux-musl job to use alpine …
Gioee Aug 7, 2025
dfec330
fix(workflow): enhance linux-musl arm64 job to build and install Open…
Gioee Aug 7, 2025
f89111d
fix(workflow): update arm64 dependencies for linux-musl job to includ…
Gioee Aug 7, 2025
67beb6b
fix(workflow): add CPPFLAGS for musl-gcc configuration in OpenSSL bui…
Gioee Aug 7, 2025
5d38bd4
fix(workflow): update linux-musl arm64 job to use Docker for building…
Gioee Aug 7, 2025
9f9fccf
fix(workflow): update OS version for linux-musl arm64 job to use ubun…
Gioee Aug 7, 2025
6d24c5d
fix(workflow): add error handling in linux-musl arm64 build step
Gioee Aug 7, 2025
9b74fc1
fix(workflow): refactor linux-musl arm64 build to use Docker for depe…
Gioee Aug 7, 2025
049ce92
bump version to 0.8.22
Gioee Aug 7, 2025
305e1b0
fix(workflow): update OS versions in CI configuration and improve cov…
Gioee Aug 7, 2025
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
85 changes: 53 additions & 32 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,48 +11,57 @@ permissions:
jobs:
build:
runs-on: ${{ matrix.os }}
container: ${{ matrix.container && matrix.container || '' }}
name: ${{ matrix.name }}${{ matrix.arch && format('-{0}', matrix.arch) || '' }} build${{ matrix.arch != 'arm64-v8a' && matrix.name != 'ios-sim' && matrix.name != 'ios' && matrix.name != 'wasm' && matrix.name != 'apple-xcframework' && ' + test' || ''}}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
- os: ubuntu-22.04
arch: x86_64
name: linux
- os: LinuxARM64
- os: ubuntu-22.04-arm
arch: arm64
name: linux
- os: macos-latest
- os: ubuntu-22.04
arch: x86_64
name: linux-musl
container: alpine:latest
- os: ubuntu-22.04-arm
arch: arm64
name: linux-musl
- os: macos-15
name: macos
- os: windows-latest
make: COVERAGE=ON
- os: windows-2022
arch: x86_64
name: windows
- os: ubuntu-latest
- os: ubuntu-22.04
arch: arm64-v8a
name: android
make: PLATFORM=android ARCH=arm64-v8a
- os: ubuntu-latest
- os: ubuntu-22.04
arch: x86_64
name: android
make: PLATFORM=android ARCH=x86_64
sqlite-amalgamation-zip: https://sqlite.org/2025/sqlite-amalgamation-3490100.zip
- os: macos-latest
- os: macos-15
name: ios
make: PLATFORM=ios
- os: macos-latest
- os: macos-15
name: ios-sim
make: PLATFORM=ios-sim
- os: ubuntu-latest
- os: ubuntu-22.04
name: wasm
make: PLATFORM=wasm
- os: macos-latest
- os: macos-15
name: apple-xcframework
make: xcframework

defaults:
run:
shell: bash
shell: ${{ contains(matrix.container, 'alpine') && 'sh' || 'bash' }}

env:
CONNECTION_STRING: ${{ secrets.CONNECTION_STRING }}
Expand All @@ -64,15 +73,39 @@ jobs:
- uses: actions/checkout@v4.2.2

- uses: msys2/setup-msys2@v2.27.0
if: matrix.os == 'windows-latest'
if: matrix.name == 'windows'
with:
msystem: mingw64
install: >-
mingw-w64-x86_64-cc
make
install: mingw-w64-x86_64-cc make

- name: windows install dependencies
if: matrix.name == 'windows'
run: choco install sqlite -y

- name: macos install dependencies
if: matrix.name == 'macos'
run: brew link sqlite --force && brew install lcov

- name: linux-musl x86_64 install dependencies
if: matrix.name == 'linux-musl' && matrix.arch == 'x86_64'
run: apk update && apk add --no-cache gcc make curl sqlite openssl-dev musl-dev linux-headers

- name: linux-musl arm64 setup container
if: matrix.name == 'linux-musl' && matrix.arch == 'arm64'
run: |
docker run -d --name alpine \
--platform linux/arm64 \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
-e CONNECTION_STRING="${{ env.CONNECTION_STRING }}" \
-e APIKEY="${{ env.APIKEY }}" \
-e WEBLITE="${{ env.WEBLITE }}" \
alpine:latest \
tail -f /dev/null
docker exec alpine sh -c "apk update && apk add --no-cache gcc make curl sqlite openssl-dev musl-dev linux-headers"

- name: windows build curl
if: matrix.os == 'windows-latest'
if: matrix.name == 'windows'
run: make curl/windows/libcurl.a
shell: msys2 {0}

Expand All @@ -81,15 +114,7 @@ jobs:
run: sudo apt install wabt

- name: build sqlite-sync
run: make extension ${{ matrix.make && matrix.make || ''}}

- name: windows install sqlite3
if: matrix.os == 'windows-latest'
run: choco install sqlite -y

- name: macos install sqlite3 without SQLITE_OMIT_LOAD_EXTENSION
if: matrix.name == 'macos'
run: brew link sqlite --force
run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make extension ${{ matrix.make && matrix.make || ''}}

- name: android setup test environment
if: matrix.name == 'android' && matrix.arch != 'arm64-v8a'
Expand Down Expand Up @@ -135,12 +160,8 @@ jobs:
adb shell "sh /data/local/tmp/commands.sh"

- name: test sqlite-sync
if: matrix.name == 'linux' || matrix.name == 'windows'
run: make test

- name: test sqlite-sync + coverage
if: matrix.name == 'macos'
run: brew install lcov && make test COVERAGE=true
if: contains(matrix.name, 'linux') || matrix.name == 'windows' || matrix.name == 'macos'
run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make test ${{ matrix.make && matrix.make || ''}}

- uses: actions/upload-pages-artifact@v3.0.1
if: matrix.name == 'macos'
Expand All @@ -155,7 +176,7 @@ jobs:
if-no-files-found: error

release:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
name: release
needs: build
if: github.ref == 'refs/heads/main'
Expand Down
7 changes: 3 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ CC = gcc
CFLAGS = -Wall -Wextra -Wno-unused-parameter -I$(SRC_DIR) -I$(SQLITE_DIR) -I$(CURL_DIR)/include
T_CFLAGS = $(CFLAGS) -DSQLITE_CORE -DCLOUDSYNC_UNITTEST -DCLOUDSYNC_OMIT_NETWORK -DCLOUDSYNC_OMIT_PRINT_RESULT
LDFLAGS = -L./$(CURL_DIR)/$(PLATFORM) -lcurl
COVERAGE = false

# Directories
SRC_DIR = src
Expand Down Expand Up @@ -128,7 +127,7 @@ else # linux
STRIP = strip --strip-unneeded $@
endif

ifneq ($(COVERAGE),false)
ifdef COVERAGE
ifneq (,$(filter $(platform),linux windows))
T_LDFLAGS += -lgcov
endif
Expand Down Expand Up @@ -207,7 +206,7 @@ $(BUILD_TEST)/%.o: %.c
test: $(TARGET) $(TEST_TARGET)
$(SQLITE3) ":memory:" -cmd ".bail on" ".load ./$<" "SELECT cloudsync_version();"
set -e; for t in $(TEST_TARGET); do ./$$t; done
ifneq ($(COVERAGE),false)
ifdef COVERAGE
mkdir -p $(COV_DIR)
lcov --capture --directory . --output-file $(COV_DIR)/coverage.info $(subst src, --include src,${COV_FILES})
genhtml $(COV_DIR)/coverage.info --output-directory $(COV_DIR)
Expand Down Expand Up @@ -386,7 +385,7 @@ help:
@echo "Targets:"
@echo " all - Build the extension (default)"
@echo " clean - Remove built files"
@echo " test [COVERAGE=true] - Test the extension with optional coverage output"
@echo " test [COVERAGE=ON] - Test the extension with optional coverage output"
@echo " help - Display this help message"

.PHONY: all clean test extension help xcframework
2 changes: 1 addition & 1 deletion src/cloudsync.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "sqlite3.h"
#endif

#define CLOUDSYNC_VERSION "0.8.21"
#define CLOUDSYNC_VERSION "0.8.22"

int sqlite3_cloudsync_init (sqlite3 *db, char **pzErrMsg, const sqlite3_api_routines *pApi);

Expand Down