Skip to content

Commit d70bdf2

Browse files
author
danny
committed
Caching other flutter builds
1 parent 94e0d63 commit d70bdf2

1 file changed

Lines changed: 26 additions & 26 deletions

File tree

.github/workflows/build.yaml

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,6 @@ jobs:
7979
~/.gradle/caches
8080
./macless_haystack/.dart_tool
8181
key: flutter-android-${{ runner.os }}-${{ hashFiles('macless_haystack/pubspec.lock') }}
82-
- name: Cache Android SDK
83-
uses: actions/cache@v5
84-
id: android-sdk-cache
85-
with:
86-
path: |
87-
~/android-sdk
88-
~/.android/cache
89-
key: android-sdk-${{ runner.os }}
9082
- name: Android Build
9183
working-directory: ./macless_haystack
9284
env:
@@ -97,37 +89,45 @@ jobs:
9789
if [ "${{ steps.flutter-android-cache.outputs.cache-hit }}" != "true" ]; then
9890
flutter pub get
9991
fi
92+
flutter test
10093
flutter build apk --release --build-name=${{ env.VERSION }}
10194
mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/android-application.apk
10295
# - name: Upload Android Artifacts
10396
# uses: actions/upload-artifact@v4
10497
# with:
10598
# name: android-application
10699
# path: ./macless_haystack/build/app/outputs/flutter-apk/android-application.apk
107-
# - name: GH-Page Build
108-
# working-directory: ./macless_haystack
109-
# run: |
110-
# flutter pub get --offline
111-
# flutter build web --profile --base-href "/macless-haystack/"
112-
# - name: Cache Flutter Pub
113-
# uses: actions/cache@v4
114-
# id: flutter-pub-cache
115-
# with:
116-
# path: ~/.pub-cache
117-
# key: ${{ runner.os }}-pub-${{ hashFiles('macless_haystack/pubspec.lock') }}
118-
# restore-keys: ${{ runner.os }}-pub-
100+
- name: Cache Flutter Web Build
101+
uses: actions/cache@v5
102+
id: flutter-web-cache
103+
with:
104+
path: |
105+
~/.pub-cache
106+
./macless_haystack/.dart_tool
107+
./macless_haystack/build/web # Web-Build Output
108+
key: flutter-web-${{ runner.os }}-${{ hashFiles('macless_haystack/pubspec.lock') }}
109+
restore-keys: |
110+
flutter-web-${{ runner.os }}-
111+
- name: GH-Page Build
112+
working-directory: ./macless_haystack
113+
run: |
114+
if [ "${{ steps.flutter-web-cache.outputs.cache-hit }}" != "true" ]; then
115+
flutter pub get
116+
fi
117+
flutter build web --profile --base-href "/macless-haystack/"
119118
# - name: Deploy to Github Pages
120119
# if: github.ref == 'refs/heads/dev'
121120
# uses: JamesIves/github-pages-deploy-action@v4
122121
# with:
123122
# folder: ./macless_haystack/build/web
124123
#
125-
# - name: Web Build
126-
# working-directory: ./macless_haystack
127-
# run: |
128-
# flutter pub get
129-
# flutter test
130-
# flutter build web --release
124+
- name: Web Build
125+
working-directory: ./macless_haystack
126+
run: |
127+
if [ "${{ steps.flutter-web-cache.outputs.cache-hit }}" != "true" ]; then
128+
flutter pub get
129+
fi
130+
flutter build web --release
131131
# - name: Copy files to web application
132132
# run: |
133133
# mkdir -p ./macless_haystack/build/webapplication

0 commit comments

Comments
 (0)