File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 3232 FLUTTER_OS=" ${FLUTTER_OS} _$ARCH "
3333fi
3434
35- # Flutter runner tool cache
35+ # Flutter runner tool cache and pub cache
3636# path: "${{ runner.tool_cache }}/flutter-${{ runner.os }}-${{ inputs.version }}-${{ runner.arch }}"
3737# key: flutter-action-setup-flutter-${{ runner.os }}-${{ inputs.version }}-${{ runner.arch }}
3838FLUTTER_RUNNER_TOOL_CACHE=" ${RUNNER_TOOL_CACHE} /flutter-${RUNNER_OS} -${FLUTTER_VERSION} -${RUNNER_ARCH} "
39+ FLUTTER_PUB_CACHE=" ${RUNNER_TEMP} /pub-cache"
3940
4041# Check if Flutter SDK already exists
4142# Otherwise download and install
8889fi
8990
9091# Configure pub to use a fixed location.
91- echo " PUB_CACHE=${HOME} /.pub-cache " >> $GITHUB_ENV
92+ echo " PUB_CACHE=${FLUTTER_PUB_CACHE} " >> $GITHUB_ENV
9293
9394# Update paths.
94- echo " ${HOME} /.pub-cache /bin" >> $GITHUB_PATH
95+ echo " ${FLUTTER_PUB_CACHE} /bin" >> $GITHUB_PATH
9596echo " ${FLUTTER_RUNNER_TOOL_CACHE} /flutter/bin" >> $GITHUB_PATH
9697
9798# Report success, and print version.
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ inputs:
1313 required : false
1414 default : " stable"
1515 cache :
16+ description : ' Cache the pub dependencies. Default: false'
17+ required : false
18+ default : " false"
19+ cache-sdk :
1620 description : ' Cache the installed Flutter SDK. Default: false'
1721 required : false
1822 default : " false"
@@ -23,10 +27,18 @@ inputs:
2327runs :
2428 using : " composite"
2529 steps :
26- - if : ${{ inputs.cache == 'true' }}
30+ # Cache the Flutter SDK
31+ - if : ${{ inputs.cache-sdk == 'true' }}
2732 uses : actions/cache@v3
2833 with :
2934 path : ${{ runner.tool_cache }}/flutter-${{ runner.os }}-${{ inputs.version }}-${{ runner.arch }}
3035 key : flutter-action-setup-flutter-${{ runner.os }}-${{ inputs.version }}-${{ inputs.channel }}-${{ runner.arch }}-${{ inputs.cache-key }}
36+ # Cache the pub dependencies
37+ - if : ${{ inputs.cache == 'true' }}
38+ uses : actions/cache@v3
39+ with :
40+ path : ${{ runner.temp }}/pub-cache
41+ key : flutter-action-setup-flutter-${{ runner.os }}-${{ inputs.version }}-${{ inputs.channel }}-${{ runner.arch }}-${{ inputs.cache-key }}-pub-cache
42+ # Run the action
3143 - run : $GITHUB_ACTION_PATH/action.sh ${{ inputs.version }} ${{ inputs.channel }}
3244 shell : bash
You can’t perform that action at this time.
0 commit comments