Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache mocks #6743

Closed
wants to merge 13 commits into from
Closed
31 changes: 30 additions & 1 deletion .github/workflows/flutter-prep.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
# found in the LICENSE file.

name: Flutter SDK prep

on:
workflow_call:
inputs:
Expand All @@ -15,6 +14,9 @@ on:
latest_flutter_candidate:
description: "The latest Flutter candidate version."
value: ${{ jobs.reusable-flutter-prep.outputs.latest_flutter_candidate }}
mock_cache_key:
description: "The key used to cache the mocks"
value: ${{ steps.determine-mocks-cache-id.outputs.mocks_cache_id}}

jobs:
reusable-flutter-prep:
Expand Down Expand Up @@ -71,3 +73,30 @@ jobs:
./flutter-sdk/bin/flutter config --no-analytics
./flutter-sdk/bin/flutter doctor
./flutter-sdk/bin/cache/dart-sdk/bin/dart --disable-analytics
- name: Determine Mocks Cache Id
id: determine-mocks-cache-id
run: echo "mocks_cache_id=$MOCKS_CACHE_ID" >> "GITHUB_OUTPUT"
env:
MOCKS_CACHE_ID: mocks-${{ runner.os }}-${{ steps.flutter-candidate.outputs.FLUTTER_CANDIDATE }}-${{env.GITHUB_SHA}}
- name: Generate Mocks
run: |
export PATH="$PATH":`pwd`/flutter-sdk/bin/cache/dart-sdk/bin/
export PATH="$PATH":`pwd`/flutter-sdk/bin/

pushd tool
flutter pub get
popd

echo $PATH
# Fetch dependencies
./tool/bin/devtools_tool pub-get --only-main


# Generate code.
./tool/bin/devtools_tool generate-code
- name: Cache Mocks
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
with:
path: |
./packages/**mocks**
key: ${{env.MOCK_CACHE_KEY}}