Skip to content

Commit ba8097b

Browse files
authored
fix(quality): remove unused variables and exclude web from tests
2 parents 13ccda9 + 517d463 commit ba8097b

6 files changed

Lines changed: 61 additions & 47 deletions

File tree

.github/workflows/code-integration.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: melos bootstrap
4848

4949
- name: Run Unit Tests
50-
run: melos test
50+
run: melos exec --fail-fast --ignore="*_web" --concurrency=1 -- flutter test
5151

5252
platform_tests:
5353
name: Platform Tests
@@ -78,14 +78,26 @@ jobs:
7878
restore-keys: |
7979
${{ runner.os }}-pub-
8080
81-
- name: Install Melos
81+
- name: Install Melos (Unix)
82+
if: runner.os != 'Windows'
8283
run: |
8384
flutter pub global activate melos
8485
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
8586
86-
- name: Bootstrap Workspace
87+
- name: Install Melos (Windows)
88+
if: runner.os == 'Windows'
89+
run: flutter pub global activate melos
90+
shell: pwsh
91+
92+
- name: Bootstrap Workspace (Unix)
93+
if: runner.os != 'Windows'
8794
run: melos bootstrap
8895

96+
- name: Bootstrap Workspace (Windows)
97+
if: runner.os == 'Windows'
98+
run: flutter pub global run melos bootstrap
99+
shell: pwsh
100+
89101
- name: Run Platform Tests
90102
run: flutter test
91103
working-directory: packages/local_storage_cache

.github/workflows/release.yml

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- 'v*.*.*'
77

88
permissions:
99
contents: write
1010

1111
jobs:
12-
create_release:
12+
create-release:
1313
name: Create Release
1414
runs-on: ubuntu-latest
1515

@@ -19,51 +19,57 @@ jobs:
1919
with:
2020
fetch-depth: 0
2121

22-
- name: Get Tag Name
23-
id: tag
24-
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
22+
- name: Set Up Flutter
23+
uses: subosito/flutter-action@v2
24+
with:
25+
channel: stable
26+
cache: true
2527

26-
- name: Get Previous Tag
27-
id: prev_tag
28+
- name: Install Melos
2829
run: |
29-
PREV_TAG=$(git describe --tags --abbrev=0 ${{ steps.tag.outputs.tag }}^ 2>/dev/null || echo "")
30-
echo "prev_tag=${PREV_TAG}" >> $GITHUB_OUTPUT
30+
flutter pub global activate melos
31+
echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH
32+
33+
- name: Bootstrap Workspace
34+
run: melos bootstrap
35+
36+
- name: Run Tests
37+
run: melos test
38+
39+
- name: Run Analysis
40+
run: melos analyze
3141

3242
- name: Generate Changelog
3343
id: changelog
3444
run: |
35-
if [ -z "${{ steps.prev_tag.outputs.prev_tag }}" ]; then
36-
CHANGELOG=$(git log --pretty=format:"- %s (%h)" ${{ steps.tag.outputs.tag }})
45+
# Get previous tag
46+
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
47+
48+
if [ -z "$PREV_TAG" ]; then
49+
# First release, get all commits
50+
COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges)
3751
else
38-
CHANGELOG=$(git log --pretty=format:"- %s (%h)" ${{ steps.prev_tag.outputs.prev_tag }}..${{ steps.tag.outputs.tag }})
52+
# Get commits since previous tag
53+
COMMITS=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s (%h)" --no-merges)
3954
fi
40-
echo "changelog<<EOF" >> $GITHUB_OUTPUT
41-
echo "$CHANGELOG" >> $GITHUB_OUTPUT
42-
echo "EOF" >> $GITHUB_OUTPUT
55+
56+
# Save to file for multiline output
57+
echo "$COMMITS" > changelog.txt
58+
59+
# Set output
60+
echo "previous_tag=$PREV_TAG" >> $GITHUB_OUTPUT
4361
4462
- name: Create Release
45-
uses: softprops/action-gh-release@v2
63+
uses: softprops/action-gh-release@v1
4664
with:
47-
tag_name: ${{ steps.tag.outputs.tag }}
48-
name: Release ${{ steps.tag.outputs.tag }}
49-
body: |
50-
## Changes in ${{ steps.tag.outputs.tag }}
51-
52-
${{ steps.changelog.outputs.changelog }}
53-
54-
## Installation
55-
56-
Add this to your package's `pubspec.yaml` file:
57-
58-
```yaml
59-
dependencies:
60-
local_storage_cache: ${{ steps.tag.outputs.tag }}
61-
```
62-
63-
## Full Changelog
64-
65-
See [CHANGELOG.md](https://github.com/protheeuz/local-storage-cache/blob/${{ steps.tag.outputs.tag }}/packages/local_storage_cache/CHANGELOG.md) for detailed changes.
65+
body_path: changelog.txt
6666
draft: false
67-
prerelease: ${{ contains(steps.tag.outputs.tag, '-') }}
67+
prerelease: false
68+
generate_release_notes: true
6869
env:
6970
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71+
72+
- name: Notify Success
73+
run: |
74+
echo "✅ Release ${{ github.ref_name }} created successfully!"
75+
echo "📦 View release at: https://github.com/${{ github.repository }}/releases/tag/${{ github.ref_name }}"

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ build/
3131
.flutter-plugins-dependencies
3232

3333
.kiro/
34-
AGENTS.md
34+
AGENTS.md
35+
.github/RELEASE_PROCESS.md

packages/local_storage_cache/lib/src/cache/memory_cache.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ class MemoryCache {
3030
/// Maps frequency count to set of keys with that frequency.
3131
final Map<int, Set<String>> _frequencyMap = {};
3232

33-
/// Minimum frequency for LFU.
34-
int _minFrequency = 0;
35-
3633
/// Gets a value from cache.
3734
T? get<T>(String key) {
3835
final entry = _cache[key];
@@ -97,7 +94,6 @@ class MemoryCache {
9794
// Update LFU frequency map (new entries start at frequency 0)
9895
if (evictionPolicy == EvictionPolicy.lfu) {
9996
_frequencyMap.putIfAbsent(0, () => {}).add(key);
100-
_minFrequency = 0;
10197
}
10298
}
10399

packages/local_storage_cache/lib/src/optimization/query_optimizer.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ class QueryOptimizer {
173173
if (schema == null) return [];
174174

175175
final missingIndexes = <String>[];
176-
final normalizedSql = sql.toUpperCase();
177176

178177
// Check WHERE clause
179178
final whereMatch =

pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ melos:
3838

3939
test:
4040
description: Run tests in all packages
41-
run: melos exec --fail-fast -- flutter test
41+
run: melos exec --fail-fast --ignore="*_web" --concurrency=1 -- flutter test
4242

4343
test:coverage:
4444
description: Run tests with coverage in all packages
45-
run: melos exec --fail-fast -- flutter test --coverage
45+
run: melos exec --fail-fast --ignore="*_web" --concurrency=1 -- flutter test --coverage
4646

4747
clean:
4848
description: Clean all packages

0 commit comments

Comments
 (0)