Skip to content

Commit 305e1b0

Browse files
committed
fix(workflow): update OS versions in CI configuration and improve coverage handling in Makefile
1 parent 049ce92 commit 305e1b0

File tree

2 files changed

+27
-31
lines changed

2 files changed

+27
-31
lines changed

.github/workflows/main.yml

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,43 +18,44 @@ jobs:
1818
fail-fast: false
1919
matrix:
2020
include:
21-
- os: ubuntu-latest
21+
- os: ubuntu-22.04
2222
arch: x86_64
2323
name: linux
2424
- os: ubuntu-22.04-arm
2525
arch: arm64
2626
name: linux
27-
- os: ubuntu-latest
27+
- os: ubuntu-22.04
2828
arch: x86_64
2929
name: linux-musl
3030
container: alpine:latest
3131
- os: ubuntu-22.04-arm
3232
arch: arm64
3333
name: linux-musl
34-
- os: macos-latest
34+
- os: macos-15
3535
name: macos
36-
- os: windows-latest
36+
make: COVERAGE=ON
37+
- os: windows-2022
3738
arch: x86_64
3839
name: windows
39-
- os: ubuntu-latest
40+
- os: ubuntu-22.04
4041
arch: arm64-v8a
4142
name: android
4243
make: PLATFORM=android ARCH=arm64-v8a
43-
- os: ubuntu-latest
44+
- os: ubuntu-22.04
4445
arch: x86_64
4546
name: android
4647
make: PLATFORM=android ARCH=x86_64
4748
sqlite-amalgamation-zip: https://sqlite.org/2025/sqlite-amalgamation-3490100.zip
48-
- os: macos-latest
49+
- os: macos-15
4950
name: ios
5051
make: PLATFORM=ios
51-
- os: macos-latest
52+
- os: macos-15
5253
name: ios-sim
5354
make: PLATFORM=ios-sim
54-
- os: ubuntu-latest
55+
- os: ubuntu-22.04
5556
name: wasm
5657
make: PLATFORM=wasm
57-
- os: macos-latest
58+
- os: macos-15
5859
name: apple-xcframework
5960
make: xcframework
6061

@@ -72,10 +73,18 @@ jobs:
7273
- uses: actions/[email protected]
7374

7475
- uses: msys2/[email protected]
75-
if: matrix.os == 'windows-latest'
76+
if: matrix.name == 'windows'
7677
with:
7778
msystem: mingw64
7879
install: mingw-w64-x86_64-cc make
80+
81+
- name: windows install dependencies
82+
if: matrix.name == 'windows'
83+
run: choco install sqlite -y
84+
85+
- name: macos install dependencies
86+
if: matrix.name == 'macos'
87+
run: brew link sqlite --force && brew install lcov
7988

8089
- name: linux-musl x86_64 install dependencies
8190
if: matrix.name == 'linux-musl' && matrix.arch == 'x86_64'
@@ -96,7 +105,7 @@ jobs:
96105
docker exec alpine sh -c "apk update && apk add --no-cache gcc make curl sqlite openssl-dev musl-dev linux-headers"
97106
98107
- name: windows build curl
99-
if: matrix.os == 'windows-latest'
108+
if: matrix.name == 'windows'
100109
run: make curl/windows/libcurl.a
101110
shell: msys2 {0}
102111

@@ -107,14 +116,6 @@ jobs:
107116
- name: build sqlite-sync
108117
run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make extension ${{ matrix.make && matrix.make || ''}}
109118

110-
- name: windows install sqlite3
111-
if: matrix.os == 'windows-latest'
112-
run: choco install sqlite -y
113-
114-
- name: macos install sqlite3 without SQLITE_OMIT_LOAD_EXTENSION
115-
if: matrix.name == 'macos'
116-
run: brew link sqlite --force
117-
118119
- name: android setup test environment
119120
if: matrix.name == 'android' && matrix.arch != 'arm64-v8a'
120121
run: |
@@ -159,12 +160,8 @@ jobs:
159160
adb shell "sh /data/local/tmp/commands.sh"
160161
161162
- name: test sqlite-sync
162-
if: contains(matrix.name, 'linux') || matrix.name == 'windows'
163-
run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make test
164-
165-
- name: test sqlite-sync + coverage
166-
if: matrix.name == 'macos'
167-
run: brew install lcov && make test COVERAGE=true
163+
if: contains(matrix.name, 'linux') || matrix.name == 'windows' || matrix.name == 'macos'
164+
run: ${{ matrix.name == 'linux-musl' && matrix.arch == 'arm64' && 'docker exec alpine' || '' }} make test ${{ matrix.make && matrix.make || ''}}
168165

169166
- uses: actions/[email protected]
170167
if: matrix.name == 'macos'
@@ -179,7 +176,7 @@ jobs:
179176
if-no-files-found: error
180177

181178
release:
182-
runs-on: ubuntu-latest
179+
runs-on: ubuntu-22.04
183180
name: release
184181
needs: build
185182
if: github.ref == 'refs/heads/main'

Makefile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ CC = gcc
3535
CFLAGS = -Wall -Wextra -Wno-unused-parameter -I$(SRC_DIR) -I$(SQLITE_DIR) -I$(CURL_DIR)/include
3636
T_CFLAGS = $(CFLAGS) -DSQLITE_CORE -DCLOUDSYNC_UNITTEST -DCLOUDSYNC_OMIT_NETWORK -DCLOUDSYNC_OMIT_PRINT_RESULT
3737
LDFLAGS = -L./$(CURL_DIR)/$(PLATFORM) -lcurl
38-
COVERAGE = false
3938

4039
# Directories
4140
SRC_DIR = src
@@ -128,7 +127,7 @@ else # linux
128127
STRIP = strip --strip-unneeded $@
129128
endif
130129

131-
ifneq ($(COVERAGE),false)
130+
ifdef COVERAGE
132131
ifneq (,$(filter $(platform),linux windows))
133132
T_LDFLAGS += -lgcov
134133
endif
@@ -207,7 +206,7 @@ $(BUILD_TEST)/%.o: %.c
207206
test: $(TARGET) $(TEST_TARGET)
208207
$(SQLITE3) ":memory:" -cmd ".bail on" ".load ./$<" "SELECT cloudsync_version();"
209208
set -e; for t in $(TEST_TARGET); do ./$$t; done
210-
ifneq ($(COVERAGE),false)
209+
ifdef COVERAGE
211210
mkdir -p $(COV_DIR)
212211
lcov --capture --directory . --output-file $(COV_DIR)/coverage.info $(subst src, --include src,${COV_FILES})
213212
genhtml $(COV_DIR)/coverage.info --output-directory $(COV_DIR)
@@ -386,7 +385,7 @@ help:
386385
@echo "Targets:"
387386
@echo " all - Build the extension (default)"
388387
@echo " clean - Remove built files"
389-
@echo " test [COVERAGE=true] - Test the extension with optional coverage output"
388+
@echo " test [COVERAGE=ON] - Test the extension with optional coverage output"
390389
@echo " help - Display this help message"
391390

392391
.PHONY: all clean test extension help xcframework

0 commit comments

Comments
 (0)