Skip to content

Commit 7430449

Browse files
check
1 parent 32e18fe commit 7430449

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed
Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
name: Flutter CI
23

34
on:
@@ -12,39 +13,61 @@ jobs:
1213
build:
1314
runs-on: ubuntu-latest
1415
steps:
16+
# Checkout the repository code
1517
- name: Checkout code
1618
uses: actions/checkout@v4
1719

20+
# Set up Flutter SDK
1821
- name: Setup Flutter
1922
uses: subosito/flutter-action@v2
2023
with:
21-
flutter-version: '3.24.4' # Should include Dart 3.6.0
22-
channel: 'stable'
23-
cache: true
24-
cache-key: flutter-3.24.4 # Force cache refresh for this version
25-
cache-path: ~/.pub-cache
24+
flutter-version: '3.24.4' # Includes Dart 3.6.0 for pubspec.yaml compatibility
25+
channel: 'stable'
26+
cache: true
27+
cache-key: flutter-3.24.4-v3 # Unique key to avoid stale cache
28+
cache-path: ~/.pub-cache
29+
30+
# Verify Flutter and Dart installation
31+
- name: Verify Flutter installation
32+
run: |
33+
if ! command -v flutter &> /dev/null; then
34+
echo "Error: Flutter command not found!"
35+
exit 1
36+
fi
37+
flutter --version
38+
dart --version
39+
echo "PATH: $PATH"
40+
echo "PUB_CACHE: $PUB_CACHE"
2641
42+
# Install dependencies
2743
- name: Install dependencies
2844
run: flutter pub get
45+
env:
46+
PUB_CACHE: ~/.pub-cache
2947

48+
# Analyze code for errors
3049
- name: Analyze code
3150
run: flutter analyze --no-pub
3251

52+
# Format code and fail if changes are needed
3353
- name: Format code
3454
run: dart format --set-exit-if-changed .
3555

56+
# Run tests
3657
- name: Run tests
3758
run: flutter test
3859

60+
# Check for publish warnings (only on master branch push)
3961
- name: Check publish warnings
40-
run: dart pub publish --dry-run
4162
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
63+
run: dart pub publish --dry-run
4264

65+
# Publish package to pub.dev (only on master branch push)
4366
- name: Publish package
4467
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
4568
uses: k-paxian/[email protected]
4669
with:
4770
accessToken: ${{ secrets.PUB_DEV_PUBLISH_ACCESS_TOKEN }}
4871
refreshToken: ${{ secrets.PUB_DEV_PUBLISH_REFRESH_TOKEN }}
4972
flutter: true
50-
skipTests: true
73+
skipTests: true

0 commit comments

Comments
 (0)