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
5 changes: 4 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
use flake
use_flake

# Remove git from PATH to keep system git
PATH_rm '/nix/store/*git-*/bin'
46 changes: 20 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,13 @@ jobs:
restore-keys: |
${{ runner.os }}-emscripten-

- name: Cache OpenSSL
uses: actions/cache@v3
with:
path: openssl-wasm
key: ${{ runner.os }}-openssl-3.3.2-wasm
restore-keys: |
${{ runner.os }}-openssl-

- name: Build OpenSSL
- name: Build WASM: OpenSSL + SQLCipher
run: |
if [ ! -d "openssl-wasm/lib" ]; then
echo "Building OpenSSL for WASM..."
nix develop --command bash -c "./build-openssl.sh"
else
echo "Using cached OpenSSL"
fi

- name: Build WASM
nix develop --command bash -c "./build-openssl.sh && ./build-wasm.sh"

- name: Build WebGL: OpenSSL + SQLCipher
run: |
nix develop --command bash -c "./build.sh"
nix develop .#webgl --command bash -c "./build-openssl.sh && ./build-webgl.sh"

- name: Prepare cross-platform test
run: |
Expand All @@ -86,14 +73,22 @@ jobs:
test -f dist/sqlcipher.cjs
test -f dist/sqlcipher.mjs
test -f dist/sqlcipher.wasm
ls -lh target/results/
test -f target/results/sqlcipher-wasm.zip
test -f target/results/sqlcipher-webgl.zip

- name: Upload build artifacts
- name: Upload WASM archive
uses: actions/upload-artifact@v4
with:
name: wasm-build
path: |
dist/
lib/
name: sqlcipher-wasm
path: target/results/sqlcipher-wasm.zip
retention-days: 30

- name: Upload WebGL archive
uses: actions/upload-artifact@v4
with:
name: sqlcipher-webgl
path: target/results/sqlcipher-webgl.zip
retention-days: 30

- name: Upload test results
Expand Down Expand Up @@ -121,7 +116,6 @@ jobs:
uses: softprops/action-gh-release@v1
with:
files: |
dist/sqlcipher.cjs
dist/sqlcipher.mjs
dist/sqlcipher.wasm
target/results/sqlcipher-wasm.zip
target/results/sqlcipher-webgl.zip
generate_release_notes: true
75 changes: 18 additions & 57 deletions .github/workflows/pr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,27 +48,12 @@ jobs:
restore-keys: |
${{ runner.os }}-emscripten-

- name: Cache OpenSSL
uses: actions/cache@v3
with:
path: openssl-wasm
key: ${{ runner.os }}-openssl-3.3.2-wasm
restore-keys: |
${{ runner.os }}-openssl-

- name: Build OpenSSL
run: |
if [ ! -d "openssl-wasm/lib" ]; then
echo "Building OpenSSL for WASM..."
nix develop --command bash -c "./build-openssl.sh"
else
echo "Using cached OpenSSL"
fi

- name: Quick build test
- name: Build
run: |
nix develop --command bash -c "./build.sh"
nix develop --command bash -c "./build-openssl.sh && ./build-wasm.sh"
nix develop .#webgl --command bash -c "./build-openssl.sh && ./build-webgl.sh"
ls -lh dist/
ls -lh target/results/

quick-test:
name: Quick Test Suite
Expand All @@ -94,26 +79,13 @@ jobs:
restore-keys: |
${{ runner.os }}-emscripten-

- name: Cache OpenSSL
uses: actions/cache@v3
with:
path: openssl-wasm
key: ${{ runner.os }}-openssl-3.3.2-wasm
restore-keys: |
${{ runner.os }}-openssl-

- name: Build OpenSSL
- name: Build WASM: OpenSSL + SQLCipher
run: |
if [ ! -d "openssl-wasm/lib" ]; then
echo "Building OpenSSL for WASM..."
nix develop --command bash -c "./build-openssl.sh"
else
echo "Using cached OpenSSL"
fi
nix develop --command bash -c "./build-openssl.sh && ./build-wasm.sh"

- name: Build
- name: Build WebGL: OpenSSL + SQLCipher
run: |
nix develop --command bash -c "./build.sh"
nix develop .#webgl --command bash -c "./build-openssl.sh && ./build-webgl.sh"

- name: Prepare cross-platform test
run: |
Expand Down Expand Up @@ -146,39 +118,28 @@ jobs:
restore-keys: |
${{ runner.os }}-emscripten-

- name: Cache OpenSSL
uses: actions/cache@v3
with:
path: openssl-wasm
key: ${{ runner.os }}-openssl-3.3.2-wasm
restore-keys: |
${{ runner.os }}-openssl-

- name: Build OpenSSL
run: |
if [ ! -d "openssl-wasm/lib" ]; then
echo "Building OpenSSL for WASM..."
nix develop --command bash -c "./build-openssl.sh"
else
echo "Using cached OpenSSL"
fi

- name: Build
run: |
nix develop --command bash -c "./build.sh"
nix develop --command bash -c "./build-openssl.sh && ./build-wasm.sh"
nix develop .#webgl --command bash -c "./build-openssl.sh && ./build-webgl.sh"
ls -lh dist/
ls -lh target/results/

- name: Check bundle sizes
run: |
echo "## Bundle Sizes" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| File | Size |" >> $GITHUB_STEP_SUMMARY
echo "|------|------|" >> $GITHUB_STEP_SUMMARY
du -h dist/sqlcipher.js | awk '{print "| sqlcipher.js | " $1 " |"}' >> $GITHUB_STEP_SUMMARY
du -h dist/sqlcipher.wasm | awk '{print "| sqlcipher.wasm | " $1 " |"}' >> $GITHUB_STEP_SUMMARY
du -h target/results/sqlcipher-wasm/sqlcipher.cjs | awk '{print "| sqlcipher.cjs | " $1 " |"}' >> $GITHUB_STEP_SUMMARY
du -h target/results/sqlcipher-wasm/sqlcipher.mjs | awk '{print "| sqlcipher.mjs | " $1 " |"}' >> $GITHUB_STEP_SUMMARY
du -h target/results/sqlcipher-wasm/sqlcipher.wasm | awk '{print "| sqlcipher.wasm | " $1 " |"}' >> $GITHUB_STEP_SUMMARY
du -h target/results/sqlcipher-wasm.zip | awk '{print "| sqlcipher-wasm.zip | " $1 " |"}' >> $GITHUB_STEP_SUMMARY
du -h target/results/sqlcipher-webgl.zip | awk '{print "| sqlcipher-webgl.zip | " $1 " |"}' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

# Check if sizes are reasonable
JS_SIZE=$(stat -c%s dist/sqlcipher.js)
JS_SIZE=$(stat -c%s dist/sqlcipher.cjs)
WASM_SIZE=$(stat -c%s dist/sqlcipher.wasm)

if [ $JS_SIZE -gt 100000 ]; then
Expand Down
7 changes: 1 addition & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@
test-db.html

# Build artifacts
build/
target/
dist/
*.wasm
*.js.mem

# OpenSSL build artifacts
openssl-*/
openssl-wasm/
*.tar.gz

# Emscripten cache
.emscripten-cache/

Expand Down
Loading