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 32
32
FLUTTER_OS=" ${FLUTTER_OS} _$ARCH "
33
33
fi
34
34
35
- # Flutter runner tool cache
35
+ # Flutter runner tool cache and pub cache
36
36
# path: "${{ runner.tool_cache }}/flutter-${{ runner.os }}-${{ inputs.version }}-${{ runner.arch }}"
37
37
# key: flutter-action-setup-flutter-${{ runner.os }}-${{ inputs.version }}-${{ runner.arch }}
38
38
FLUTTER_RUNNER_TOOL_CACHE=" ${RUNNER_TOOL_CACHE} /flutter-${RUNNER_OS} -${FLUTTER_VERSION} -${RUNNER_ARCH} "
39
+ FLUTTER_PUB_CACHE=" ${RUNNER_TEMP} /pub-cache"
39
40
40
41
# Check if Flutter SDK already exists
41
42
# Otherwise download and install
88
89
fi
89
90
90
91
# 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
92
93
93
94
# Update paths.
94
- echo " ${HOME} /.pub-cache /bin" >> $GITHUB_PATH
95
+ echo " ${FLUTTER_PUB_CACHE} /bin" >> $GITHUB_PATH
95
96
echo " ${FLUTTER_RUNNER_TOOL_CACHE} /flutter/bin" >> $GITHUB_PATH
96
97
97
98
# Report success, and print version.
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ inputs:
13
13
required : false
14
14
default : " stable"
15
15
cache :
16
+ description : ' Cache the pub dependencies. Default: false'
17
+ required : false
18
+ default : " false"
19
+ cache-sdk :
16
20
description : ' Cache the installed Flutter SDK. Default: false'
17
21
required : false
18
22
default : " false"
@@ -23,10 +27,18 @@ inputs:
23
27
runs :
24
28
using : " composite"
25
29
steps :
26
- - if : ${{ inputs.cache == 'true' }}
30
+ # Cache the Flutter SDK
31
+ - if : ${{ inputs.cache-sdk == 'true' }}
27
32
uses : actions/cache@v3
28
33
with :
29
34
path : ${{ runner.tool_cache }}/flutter-${{ runner.os }}-${{ inputs.version }}-${{ runner.arch }}
30
35
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
31
43
- run : $GITHUB_ACTION_PATH/action.sh ${{ inputs.version }} ${{ inputs.channel }}
32
44
shell : bash
You can’t perform that action at this time.
0 commit comments