Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9723661
bugfix-103-replace-deprecated-zstdgetdecompressedsize-with-zstdgetfra…
efraespada Mar 14, 2026
2b8cbe1
docs: enhance README and example documentation for zstandard plugin
efraespada Mar 15, 2026
1010c54
chore: enhance CI workflows and documentation for coverage reporting
efraespada Mar 15, 2026
d951b3b
chore: update zstandard plugin configuration and macOS integration
efraespada Mar 15, 2026
3d1b10d
docs: update building and CI/CD documentation for zstandard plugin
efraespada Mar 15, 2026
87b3667
docs: update building and CI/CD documentation for zstandard plugin
efraespada Mar 15, 2026
796d991
chore: update documentation and scripts for zstd source management
efraespada Mar 15, 2026
63d576a
chore: streamline zstd source management and update build scripts
efraespada Mar 15, 2026
2cd385d
chore: sync zstd source for iOS and macOS plugins
efraespada Mar 15, 2026
d6bfc4b
chore: refine zstd syncing process for iOS and macOS plugins
efraespada Mar 15, 2026
4b7a7f4
chore: update podspec files for zstd syncing process in iOS and macOS
efraespada Mar 15, 2026
15a17a9
chore: refine zstd syncing process in podspec and example Podfile
efraespada Mar 15, 2026
e18674d
chore: simplify zstd syncing in Podfile and podspec
efraespada Mar 15, 2026
573ad14
chore: update zstd syncing process in podspecs and documentation
efraespada Mar 15, 2026
b668a33
chore: enhance zstandard_ios podspec for improved syncing and compati…
efraespada Mar 15, 2026
7a93108
chore: update zstandard_ios podspec to include additional public head…
efraespada Mar 15, 2026
4d5db08
chore: remove pre_install hook for zstd syncing in macOS Podfile
efraespada Mar 15, 2026
272202c
chore: remove iOS/macOS zstd symlinks documentation
efraespada Mar 15, 2026
5ead191
chore: update documentation for zstd syncing in iOS and macOS
efraespada Mar 15, 2026
83b62ce
chore: update README and scripts for zstd.js and zstd.wasm generation
efraespada Mar 15, 2026
bafa6ee
chore: enhance CI workflows for coverage and performance checks
efraespada Mar 15, 2026
6f58a8b
refactor: simplify test structure for web compatibility
efraespada Mar 15, 2026
4c365c0
chore: update CI workflows and testing structure for integration tests
efraespada Mar 15, 2026
26b3391
chore: update Android emulator setup and build configurations
efraespada Mar 15, 2026
d839a64
fix: correct decompression return logic in ZstandardIOS
efraespada Mar 16, 2026
f4cfaa8
fix: update decompression logic across platforms
efraespada Mar 16, 2026
edd571b
chore: update web testing documentation and integration script
efraespada Mar 16, 2026
cac4928
refactor: streamline macOS and Windows integration testing
efraespada Mar 16, 2026
529efee
chore: enhance CI workflows for unit and integration testing
efraespada Mar 16, 2026
ca8a31a
chore: update release workflow for improved version management
efraespada Mar 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Dependabot: keep GitHub Actions up to date (pinned to SHA in release_workflow)
# https://docs.github.com/en/code-security/dependabot

version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
commit-message:
prefix: "deps(ci)"
labels:
- "dependencies"
- "github-actions"
103 changes: 103 additions & 0 deletions .github/scripts/update_versions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
// ignore_for_file: avoid_print
/// Updates version and dependency versions across federated plugin pubspec files.
/// Usage: dart run .github/scripts/update_versions.dart <new_version>
/// Example: dart run .github/scripts/update_versions.dart 1.3.30

import 'dart:io';

void main(List<String> args) {
if (args.length != 1) {
print('Usage: dart run .github/scripts/update_versions.dart <new_version>');
exit(1);
}
final version = args.single.trim();
if (!RegExp(r'^\d+\.\d+\.\d+$').hasMatch(version)) {
print('Error: version must be semver (e.g. 1.0.0), got: $version');
exit(1);
}

final repoRoot = _findRepoRoot();
final packages = _packageConfig(repoRoot);

for (final entry in packages.entries) {
final path = '${repoRoot}/${entry.key}/pubspec.yaml';
final file = File(path);
if (!file.existsSync()) {
print('Error: $path not found');
exit(1);
}
var content = file.readAsStringSync();
content = _updateVersionInContent(content, entry.value, version);
file.writeAsStringSync(content);
print('Updated $path');
}

print('Verifying...');
for (final entry in packages.entries) {
final path = '${repoRoot}/${entry.key}/pubspec.yaml';
final content = File(path).readAsStringSync();
if (!content.contains('version: $version')) {
print('Error: $path does not contain version: $version after update');
exit(1);
}
for (final dep in entry.value.deps) {
if (!content.contains('$dep: ^$version') && !content.contains('$dep: $version')) {
print('Error: $path missing dependency $dep: ^$version');
exit(1);
}
}
}
print('All versions updated and verified.');
}

String _findRepoRoot() {
var dir = Directory.current.path;
while (dir != '/' && dir.isNotEmpty) {
if (File('$dir/pubspec.yaml').existsSync() || File('$dir/zstandard/pubspec.yaml').existsSync()) {
if (File('$dir/zstandard/pubspec.yaml').existsSync()) return dir;
}
dir = Directory(dir).parent.path;
}
return Directory.current.path;
}

String _updateVersionInContent(String content, PackageSpec spec, String version) {
content = content.replaceFirst(
RegExp(r'^version:\s*[\d.]+\s*$', multiLine: true),
'version: $version\n',
);
for (final dep in spec.deps) {
content = content.replaceFirstMapped(
RegExp(r'(\s*' + dep + r':\s*)\^?[\d.]+'),
(m) => '${m[1]}^$version',
);
}
return content;
}

class PackageSpec {
const PackageSpec({required this.deps});
final List<String> deps;
}

Map<String, PackageSpec> _packageConfig(String root) {
return {
'zstandard_platform_interface': const PackageSpec(deps: []),
'zstandard_android': const PackageSpec(deps: ['zstandard_platform_interface']),
'zstandard_ios': const PackageSpec(deps: ['zstandard_platform_interface']),
'zstandard_macos': const PackageSpec(deps: ['zstandard_platform_interface']),
'zstandard_linux': const PackageSpec(deps: ['zstandard_platform_interface']),
'zstandard_windows': const PackageSpec(deps: ['zstandard_platform_interface']),
'zstandard_web': const PackageSpec(deps: ['zstandard_platform_interface']),
'zstandard_cli': const PackageSpec(deps: []),
'zstandard': const PackageSpec(deps: [
'zstandard_platform_interface',
'zstandard_android',
'zstandard_ios',
'zstandard_linux',
'zstandard_macos',
'zstandard_web',
'zstandard_windows',
]),
};
}
42 changes: 42 additions & 0 deletions .github/scripts/verify-pubdev-package.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/env bash
# Verify that a package version is available on pub.dev (with exponential backoff, max 10 min).
# Usage: verify-pubdev-package.sh <package_name> <expected_version>
# Exit 0 when version is available, 1 on timeout or invalid args.

set -euo pipefail

PACKAGE="${1:?Usage: $0 <package_name> <expected_version>}"
EXPECTED_VERSION="${2:?Usage: $0 <package_name> <expected_version>}"
MAX_WAIT_SEC=600
INITIAL_SLEEP=30
API_URL="https://pub.dev/api/packages/${PACKAGE}"

elapsed=0
sleep_sec=$INITIAL_SLEEP

echo "Checking pub.dev for ${PACKAGE}@${EXPECTED_VERSION} (max ${MAX_WAIT_SEC}s)..."

while [ $elapsed -lt $MAX_WAIT_SEC ]; do
if resp=$(curl -sS -f "$API_URL" 2>/dev/null); then
if echo "$resp" | grep -q "\"version\":\"${EXPECTED_VERSION}\""; then
echo "Package ${PACKAGE}@${EXPECTED_VERSION} is available on pub.dev."
exit 0
fi
# Also accept version in "versions" array
if echo "$resp" | grep -q "\"${EXPECTED_VERSION}\""; then
echo "Package ${PACKAGE} version ${EXPECTED_VERSION} is available on pub.dev."
exit 0
fi
fi
echo " Not yet available (elapsed ${elapsed}s), waiting ${sleep_sec}s..."
sleep "$sleep_sec"
elapsed=$((elapsed + sleep_sec))
# Exponential backoff: 30, 45, 60, 90, 120, 120, ...
if [ $sleep_sec -lt 120 ]; then
sleep_sec=$((sleep_sec + 15))
[ $sleep_sec -gt 120 ] && sleep_sec=120
fi
done

echo "ERROR: ${PACKAGE}@${EXPECTED_VERSION} not available on pub.dev after ${MAX_WAIT_SEC}s."
exit 1
38 changes: 34 additions & 4 deletions .github/workflows/push_checks_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,42 @@ jobs:
flutter-version: '3.35.6'

- name: Get dependencies
working-directory: zstandard_android
working-directory: zstandard_android/example
run: flutter pub get

- name: Test check
working-directory: zstandard_android
run: flutter test
- name: Create and start emulator
run: |
chmod +x scripts/manage_android_emulator.sh
./scripts/manage_android_emulator.sh create || true
./scripts/manage_android_emulator.sh start

- name: Run integration tests
run: |
DEVICE_ID=$(./scripts/manage_android_emulator.sh device-id)
cd zstandard_android/example && flutter test integration_test/ -d "$DEVICE_ID" --coverage

- name: Stop emulator
if: always()
run: ./scripts/manage_android_emulator.sh stop || true

- name: Install lcov
run: brew install lcov

- name: Check coverage threshold (95%)
working-directory: zstandard_android/example
run: |
if [ -f coverage/lcov.info ]; then
COVERAGE=$(lcov --summary coverage/lcov.info 2>&1 | grep "lines" | awk '{print $2}' | sed 's/%//')
echo "Coverage: ${COVERAGE}%"
if [ -n "$COVERAGE" ] && (( $(echo "$COVERAGE < 95" | bc -l) )); then echo "ERROR: Coverage ${COVERAGE}% is below 95%"; exit 1; fi
fi

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: zstandard_android/example/coverage/lcov.info
flags: android
fail_ci_if_error: false

check_android_publish_dry_run:
name: Dry Run Publish Android
Expand Down
39 changes: 38 additions & 1 deletion .github/workflows/push_checks_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ jobs:
check_cli_test:
name: Test CLI
runs-on: [self-hosted, macOS]
timeout-minutes: 30
steps:
- uses: actions/checkout@v4

Expand All @@ -52,7 +53,43 @@ jobs:

- name: Test check
working-directory: zstandard_cli
run: dart test
run: dart test --coverage=coverage

- name: Format coverage to lcov
working-directory: zstandard_cli
run: dart run coverage:format_coverage --lcov -i coverage -o coverage/lcov.info --packages=.dart_tool/package_config.json

- name: Install lcov
run: brew install lcov

- name: Check coverage threshold (95%)
working-directory: zstandard_cli
run: |
COVERAGE=$(lcov --summary coverage/lcov.info 2>&1 | grep "lines" | awk '{print $2}' | sed 's/%//')
echo "Coverage: ${COVERAGE}%"
if [ -z "$COVERAGE" ]; then echo "Could not parse coverage"; exit 1; fi
if (( $(echo "$COVERAGE < 95" | bc -l) )); then echo "ERROR: Coverage ${COVERAGE}% is below 95%"; exit 1; fi

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: zstandard_cli/coverage/lcov.info
flags: cli
fail_ci_if_error: true

- name: Run benchmarks
working-directory: zstandard_cli
run: dart run benchmark/benchmark_suite.dart --output=benchmark_results.json || true

- name: Check performance regression (if baseline exists)
working-directory: zstandard_cli
run: |
if [ -f benchmark/baselines/baseline_macos_arm64.json ]; then
dart run ../../scripts/check_performance_regression.dart \
--baseline=benchmark/baselines/baseline_macos_arm64.json \
--current=benchmark_results.json \
--threshold=0.10 || true
fi

check_cli_publish_dry_run:
name: Dry Run Publish CLI
Expand Down
33 changes: 29 additions & 4 deletions .github/workflows/push_checks_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,37 @@ jobs:
flutter-version: '3.35.6'

- name: Get dependencies
working-directory: zstandard_ios
working-directory: zstandard_ios/example
run: flutter pub get

- name: Test check
working-directory: zstandard_ios
run: flutter test
- name: Boot iOS simulator
run: |
chmod +x scripts/manage_ios_simulator.sh
./scripts/manage_ios_simulator.sh start

- name: Run integration tests
run: |
DEVICE_ID=$(./scripts/manage_ios_simulator.sh device-id)
cd zstandard_ios/example && flutter test integration_test/ -d "$DEVICE_ID" --coverage

- name: Install lcov
run: brew install lcov

- name: Check coverage threshold (95%)
working-directory: zstandard_ios/example
run: |
if [ -f coverage/lcov.info ]; then
COVERAGE=$(lcov --summary coverage/lcov.info 2>&1 | grep "lines" | awk '{print $2}' | sed 's/%//')
echo "Coverage: ${COVERAGE}%"
if [ -n "$COVERAGE" ] && (( $(echo "$COVERAGE < 95" | bc -l) )); then echo "ERROR: Coverage ${COVERAGE}% is below 95%"; exit 1; fi
fi

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: zstandard_ios/example/coverage/lcov.info
flags: ios
fail_ci_if_error: false

check_ios_publish_dry_run:
name: Dry Run Publish iOS
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/push_checks_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,36 @@ jobs:
working-directory: zstandard_linux
run: flutter pub get

- name: Unit tests
working-directory: zstandard_linux
run: flutter test --coverage

- name: Get example dependencies
working-directory: zstandard_linux/example
run: flutter pub get

- name: Run integration tests
working-directory: zstandard_linux/example
run: flutter test integration_test/ -d linux

- name: Install lcov
run: sudo apt-get update && sudo apt-get install -y lcov

- name: Check coverage threshold (95%)
working-directory: zstandard_linux
run: |
COVERAGE=$(lcov --summary coverage/lcov.info 2>&1 | grep "lines" | awk '{print $2}' | sed 's/%//')
echo "Coverage: ${COVERAGE}%"
if [ -z "$COVERAGE" ]; then echo "Could not parse coverage"; exit 1; fi
if (( $(echo "$COVERAGE < 95" | bc -l) )); then echo "ERROR: Coverage ${COVERAGE}% is below 95%"; exit 1; fi

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: zstandard_linux/coverage/lcov.info
flags: linux
fail_ci_if_error: true

check_linux_publish_dry_run:
name: Dry Run Publish Linux
runs-on: [self-hosted, Linux]
Expand Down
30 changes: 27 additions & 3 deletions .github/workflows/push_checks_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,33 @@ jobs:
channel: 'stable'
flutter-version: '3.35.6'

- name: Test check
working-directory: zstandard_macos
run: flutter test
- name: Ensure macOS framework and get dependencies
run: |
chmod +x scripts/ensure_macos_framework.sh
./scripts/ensure_macos_framework.sh

- name: Run integration tests
working-directory: zstandard_macos/example
run: flutter test integration_test/ -d macos --coverage

- name: Install lcov
run: brew install lcov

- name: Check coverage threshold (95%)
working-directory: zstandard_macos/example
run: |
if [ -f coverage/lcov.info ]; then
COVERAGE=$(lcov --summary coverage/lcov.info 2>&1 | grep "lines" | awk '{print $2}' | sed 's/%//')
echo "Coverage: ${COVERAGE}%"
if [ -n "$COVERAGE" ] && (( $(echo "$COVERAGE < 95" | bc -l) )); then echo "ERROR: Coverage ${COVERAGE}% is below 95%"; exit 1; fi
fi

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: zstandard_macos/example/coverage/lcov.info
flags: macos
fail_ci_if_error: false

check_macos_publish_dry_run:
name: Dry Run Publish macOS
Expand Down
Loading
Loading