Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ebc0539
curl build in the makefile
Gioee May 26, 2025
d2d8c1b
android fix new line and arch in tests
Gioee May 26, 2025
7b84676
android define curl config inline
Gioee May 26, 2025
a1d6b75
android fix lowercase uname -s
Gioee May 26, 2025
5099222
fix windows
Gioee May 26, 2025
b1990fd
android typos
Gioee May 26, 2025
b77a02b
android arch override
Gioee May 26, 2025
056ca1c
android dynamic curl config
Gioee May 26, 2025
47a3983
android set cc in the makefile
Gioee May 26, 2025
203665a
makefile set android ndk path
Gioee May 26, 2025
0759d7d
win build with msys test
Gioee May 26, 2025
8a057c0
remove msys from makefile
Gioee May 26, 2025
9c4aa5c
windows use msys bash
Gioee May 26, 2025
2b8e2a9
makefile windows use msys make
Gioee May 26, 2025
ff0eb5b
fix: quote msys make command for Windows compatibility
Gioee May 26, 2025
47724ee
android build openssl in the makefile
Gioee May 27, 2025
165e0a3
fix android openssl prefix
Gioee May 27, 2025
d1a62b4
makefile android fix curl dependencies
Gioee May 27, 2025
37b723b
android fix makefile run recipe only one time
Gioee May 27, 2025
a809bc6
fix android makefile only openssl dependency
Gioee May 27, 2025
4de3c72
makefile fix windows make path
Gioee May 27, 2025
1f5d9bc
fix makefile to use msys bash for curl build on Windows
Gioee May 27, 2025
ece2fb6
fix makefile spacing
Gioee May 27, 2025
62c485b
fix makefile tab
Gioee May 27, 2025
b21fc4a
fix makefile to use mingw64 make for Windows build
Gioee May 27, 2025
8fe2d13
fix: update Windows build process for curl
Gioee May 28, 2025
c165acb
fix: set default shell to bash in GitHub Actions workflow
Gioee May 28, 2025
facd13b
fix: optimize make commands for parallel execution in GitHub Actions …
Gioee May 28, 2025
6a92f9a
fix: replace make command with $(MAKE) for consistency and speed up i…
Gioee May 28, 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
177 changes: 14 additions & 163 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,78 +18,34 @@ jobs:
include:
- os: ubuntu-latest
arch: x86_64
configure: --with-openssl
name: linux
- os: LinuxARM64
arch: arm64
configure: --with-openssl
name: linux
- os: macos-latest
configure:
--with-secure-transport
CFLAGS="-arch x86_64 -arch arm64"
name: macos
- os: windows-latest
arch: x86_64
configure:
--with-schannel
CFLAGS="-DCURL_STATICLIB"
name: windows
- os: ubuntu-latest
arch: arm64-v8a
configure:
--host aarch64-linux-android26
--with-openssl=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr
LIBS="-lssl -lcrypto"
AR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
AS=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-as
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang
CXX=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang++
LD=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/ld
RANLIB=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib
STRIP=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip
name: android
make:
PLATFORM=android
CC=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android26-clang
make: PLATFORM=android ARCH=arm64-v8a
- os: ubuntu-latest
arch: x86_64
configure:
--host x86_64-linux-android26
--with-openssl=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr
LIBS="-lssl -lcrypto"
AR=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar
AS=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-as
CC=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang
CXX=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang++
LD=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/ld
RANLIB=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib
STRIP=$ANDROID_NDK_HOME/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip
name: android
make:
PLATFORM=android
CC=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/x86_64-linux-android26-clang
make: PLATFORM=android ARCH=x86_64
sqlite-amalgamation-zip: https://sqlite.org/2025/sqlite-amalgamation-3490100.zip
- os: macos-latest
configure:
--host=arm64-apple-darwin
--with-secure-transport
CFLAGS="-arch arm64 -isysroot $(xcrun --sdk iphoneos --show-sdk-path) -miphoneos-version-min=11.0"
name: ios
make: PLATFORM=ios
- os: macos-latest
configure:
--host=arm64-apple-darwin
--with-secure-transport
CFLAGS="-arch x86_64 -arch arm64 -isysroot $(xcrun --sdk iphonesimulator --show-sdk-path) -miphonesimulator-version-min=11.0"
name: isim
make: PLATFORM=isim

defaults:
run:
shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }}
env:
MAKEFLAGS: -j 8
shell: bash

steps:

Expand All @@ -101,123 +57,19 @@ jobs:
msystem: mingw64
install: >-
mingw-w64-x86_64-cc
mingw-w64-x86_64-autotools make

- uses: robinraju/release-downloader@v1.12
with:
repository: curl/curl
tag: 'curl-8_12_1'
extract: true
fileName: curl-*.tar.gz
make

- name: build openssl
if: matrix.name == 'android'
run: |
git clone https://github.com/openssl/openssl.git
cd openssl
export TOOLCHAIN=$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64
export ARCH=${{ matrix.arch }}
export PATH=$TOOLCHAIN/bin:$PATH

./Configure android-${{ matrix.arch == 'arm64-v8a' && 'arm64' || matrix.arch }} \
--prefix=$PWD/build \
--openssldir=$PWD/build/ssl \
no-shared \
no-unit-test \
-D__ANDROID_API__=26
make
make install_sw

cp build/lib/libssl.a $TOOLCHAIN/sysroot/usr/lib/
cp build/lib/libcrypto.a $TOOLCHAIN/sysroot/usr/lib/
cp -r build/include/openssl $TOOLCHAIN/sysroot/usr/include/

- name: build curl
run: |

folder=$(ls -d curl-*/ 2>/dev/null | head -n 1)
cd $folder

./configure \
--without-libpsl \
--disable-alt-svc \
--disable-ares \
--disable-cookies \
--disable-basic-auth \
--disable-digest-auth \
--disable-kerberos-auth \
--disable-negotiate-auth \
--disable-aws \
--disable-dateparse \
--disable-dnsshuffle \
--disable-doh \
--disable-form-api \
--disable-hsts \
--disable-ipv6 \
--disable-libcurl-option \
--disable-manual \
--disable-mime \
--disable-netrc \
--disable-ntlm \
--disable-ntlm-wb \
--disable-progress-meter \
--disable-proxy \
--disable-pthreads \
--disable-socketpair \
--disable-threaded-resolver \
--disable-tls-srp \
--disable-verbose \
--disable-versioned-symbols \
--enable-symbol-hiding \
--without-brotli \
--without-zstd \
--without-libidn2 \
--without-librtmp \
--without-zlib \
--without-nghttp2 \
--without-ngtcp2 \
--disable-shared \
--disable-ftp \
--disable-file \
--disable-ipfs \
--disable-ldap \
--disable-ldaps \
--disable-rtsp \
--disable-dict \
--disable-telnet \
--disable-tftp \
--disable-pop3 \
--disable-imap \
--disable-smb \
--disable-smtp \
--disable-gopher \
--disable-mqtt \
--disable-docs \
--enable-static \
${{matrix.configure}}
make

# save avg 1kb more with these options
# --disable-debug \
# --enable-optimize \
# --disable-curldebug \
# --disable-get-easy-options \
# --without-fish-functions-dir \
# --without-zsh-functions-dir \
# --without-libgsasl \

cd ..
mkdir -p curl/${{ matrix.name }}
mv $folder/lib/.libs/libcurl.a curl/${{ matrix.name }}
- name: windows build curl
if: matrix.os == 'windows-latest'
run: make curl/windows/libcurl.a -j4
shell: msys2 {0}

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

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

- name: macos install sqlite3 without SQLITE_OMIT_LOAD_EXTENSION
if: matrix.name == 'macos'
Expand All @@ -237,17 +89,17 @@ jobs:
curl -O ${{ matrix.sqlite-amalgamation-zip }}
unzip sqlite-amalgamation-*.zip
export ${{ matrix.make }}
$CC sqlite-amalgamation-*/shell.c sqlite-amalgamation-*/sqlite3.c -o sqlite3 -ldl
$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/${{ matrix.arch }}-linux-android26-clang sqlite-amalgamation-*/shell.c sqlite-amalgamation-*/sqlite3.c -o sqlite3 -ldl
# remove unused folders to save up space
rm -rf sqlite-amalgamation-*.zip sqlite-amalgamation-* curl-* openssl
rm -rf sqlite-amalgamation-*.zip sqlite-amalgamation-* openssl
echo "::endgroup::"

echo "::group::prepare the test script"
make test CC=$CC PLATFORM=$PLATFORM || echo "It should fail. Running remaining commands in the emulator"
make test PLATFORM=$PLATFORM ARCH=$ARCH -j4 || echo "It should fail. Running remaining commands in the emulator"
cat > commands.sh << EOF
mv -f /data/local/tmp/sqlite3 /system/xbin
cd /data/local/tmp
$(make test CC=$CC PLATFORM=$PLATFORM -n)
$(make test PLATFORM=$PLATFORM ARCH=$ARCH -n)
EOF
echo "::endgroup::"

Expand All @@ -265,8 +117,7 @@ jobs:

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

- name: test sqlite-sync + coverage
if: matrix.name == 'macos'
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
*.sqlite
*.a
unittest
/curl-src
/curl/src
Loading